Lines Matching refs:BTRFS_I

143 	BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops;  in btrfs_test_inode_set_ops()
189 key.objectid = btrfs_ino(BTRFS_I(inode)); in insert_inline_extent()
250 BTRFS_I(inode)->disk_i_size = inode->i_size; in insert_inline_extent()
268 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range_inline()
303 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in cow_file_range_inline()
334 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in cow_file_range_inline()
335 btrfs_drop_extent_cache(BTRFS_I(inode), start, aligned_end - 1, 0); in cow_file_range_inline()
399 if (BTRFS_I(inode)->defrag_compress) in inode_need_compress()
402 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS) in inode_need_compress()
405 BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS || in inode_need_compress()
406 BTRFS_I(inode)->prop_compress) in inode_need_compress()
457 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
488 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
509 if (BTRFS_I(inode)->defrag_compress) in compress_file_range()
510 compress_type = BTRFS_I(inode)->defrag_compress; in compress_file_range()
511 else if (BTRFS_I(inode)->prop_compress) in compress_file_range()
512 compress_type = BTRFS_I(inode)->prop_compress; in compress_file_range()
653 !(BTRFS_I(inode)->prop_compress)) { in compress_file_range()
654 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in compress_file_range()
715 struct btrfs_root *root = BTRFS_I(inode)->root; in submit_compressed_extents()
725 io_tree = &BTRFS_I(inode)->io_tree; in submit_compressed_extents()
824 btrfs_drop_extent_cache(BTRFS_I(inode), in submit_compressed_extents()
850 struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; in submit_compressed_extents()
893 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in get_extent_allocation_hint()
942 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range()
955 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in cow_file_range()
965 inode_should_defrag(BTRFS_I(inode), start, end, num_bytes, SZ_64K); in cow_file_range()
995 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1044 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1085 btrfs_drop_extent_cache(BTRFS_I(inode), start, start + ram_size - 1, 0); in cow_file_range()
1182 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range_async()
1186 clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED, in cow_file_range_async()
1197 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS && in cow_file_range_async()
1259 struct btrfs_root *root = BTRFS_I(inode)->root; in run_delalloc_nocow()
1279 u64 ino = btrfs_ino(BTRFS_I(inode)); in run_delalloc_nocow()
1294 nolock = btrfs_is_free_space_inode(BTRFS_I(inode)); in run_delalloc_nocow()
1562 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in need_force_cow()
1563 !(BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC)) in need_force_cow()
1571 if (BTRFS_I(inode)->defrag_bytes && in need_force_cow()
1572 test_range_bit(&BTRFS_I(inode)->io_tree, start, end, in need_force_cow()
1592 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW && !force_cow) { in run_delalloc_range()
1595 } else if (BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC && !force_cow) { in run_delalloc_range()
1603 &BTRFS_I(inode)->runtime_flags); in run_delalloc_range()
1640 spin_lock(&BTRFS_I(inode)->lock); in btrfs_split_extent_hook()
1641 btrfs_mod_outstanding_extents(BTRFS_I(inode), 1); in btrfs_split_extent_hook()
1642 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_split_extent_hook()
1670 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_extent_hook()
1671 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_extent_hook()
1672 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_extent_hook()
1701 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_extent_hook()
1702 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_extent_hook()
1703 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_extent_hook()
1712 if (list_empty(&BTRFS_I(inode)->delalloc_inodes)) { in btrfs_add_delalloc_inodes()
1713 list_add_tail(&BTRFS_I(inode)->delalloc_inodes, in btrfs_add_delalloc_inodes()
1716 &BTRFS_I(inode)->runtime_flags); in btrfs_add_delalloc_inodes()
1778 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_set_bit_hook()
1781 bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_set_bit_hook()
1783 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1784 btrfs_mod_outstanding_extents(BTRFS_I(inode), num_extents); in btrfs_set_bit_hook()
1785 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1793 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1794 BTRFS_I(inode)->delalloc_bytes += len; in btrfs_set_bit_hook()
1796 BTRFS_I(inode)->defrag_bytes += len; in btrfs_set_bit_hook()
1798 &BTRFS_I(inode)->runtime_flags)) in btrfs_set_bit_hook()
1800 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1805 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1806 BTRFS_I(inode)->new_delalloc_bytes += state->end + 1 - in btrfs_set_bit_hook()
1808 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_bit_hook()
1819 struct btrfs_inode *inode = BTRFS_I((struct inode *)private_data); in btrfs_clear_bit_hook()
1982 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_submit_bio_hook()
1986 int async = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_bio_hook()
1988 skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; in btrfs_submit_bio_hook()
1990 if (btrfs_is_free_space_inode(BTRFS_I(inode))) in btrfs_submit_bio_hook()
2048 BTRFS_I(inode)->root->fs_info->csum_root, sum); in add_pending_csums()
2061 return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end, in btrfs_set_extent_delalloc()
2096 lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end, in btrfs_writepage_fixup_worker()
2103 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_writepage_fixup_worker()
2106 unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, in btrfs_writepage_fixup_worker()
2134 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, false); in btrfs_writepage_fixup_worker()
2136 unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end, in btrfs_writepage_fixup_worker()
2189 struct btrfs_root *root = BTRFS_I(inode)->root; in insert_reserved_file_extent()
2218 ins.objectid = btrfs_ino(BTRFS_I(inode)); in insert_reserved_file_extent()
2260 btrfs_ino(BTRFS_I(inode)), in insert_reserved_file_extent()
2380 if (BTRFS_I(inode)->root->root_key.objectid == root_id && in record_one_backref()
2381 inum == btrfs_ino(BTRFS_I(inode))) in record_one_backref()
2600 lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, lock_end, in relink_extent_backref()
2650 key.objectid = btrfs_ino(BTRFS_I(inode)); in relink_extent_backref()
2728 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, lock_end, in relink_extent_backref()
2803 struct btrfs_root *root = BTRFS_I(inode)->root; in record_old_file_extents()
2827 key.objectid = btrfs_ino(BTRFS_I(inode)); in record_old_file_extents()
2862 if (key.objectid != btrfs_ino(BTRFS_I(inode))) in record_old_file_extents()
2935 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_finish_ordered_io()
2937 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_finish_ordered_io()
2953 nolock = btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_finish_ordered_io()
2960 btrfs_free_io_failure_record(BTRFS_I(inode), in btrfs_finish_ordered_io()
2993 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
3010 if (0 && last_snapshot >= BTRFS_I(inode)->generation) in btrfs_finish_ordered_io()
3029 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
3037 ret = btrfs_mark_extent_written(trans, BTRFS_I(inode), in btrfs_finish_ordered_io()
3055 unpin_extent_cache(&BTRFS_I(inode)->extent_tree, in btrfs_finish_ordered_io()
3084 clear_extent_bit(&BTRFS_I(inode)->io_tree, in btrfs_finish_ordered_io()
3107 btrfs_drop_extent_cache(BTRFS_I(inode), start, end, 0); in btrfs_finish_ordered_io()
3174 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in btrfs_writepage_end_io_hook()
3207 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in __readpage_endio_check()
3226 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_readpage_end_io_hook()
3227 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_readpage_end_io_hook()
3234 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_readpage_end_io_hook()
3261 struct btrfs_inode *binode = BTRFS_I(inode); in btrfs_add_delayed_iput()
3576 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_read_locked_inode()
3593 memcpy(&location, &BTRFS_I(inode)->location, sizeof(location)); in btrfs_read_locked_inode()
3612 btrfs_i_size_write(BTRFS_I(inode), btrfs_inode_size(leaf, inode_item)); in btrfs_read_locked_inode()
3623 BTRFS_I(inode)->i_otime.tv_sec = in btrfs_read_locked_inode()
3625 BTRFS_I(inode)->i_otime.tv_nsec = in btrfs_read_locked_inode()
3629 BTRFS_I(inode)->generation = btrfs_inode_generation(leaf, inode_item); in btrfs_read_locked_inode()
3630 BTRFS_I(inode)->last_trans = btrfs_inode_transid(leaf, inode_item); in btrfs_read_locked_inode()
3634 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_read_locked_inode()
3638 BTRFS_I(inode)->index_cnt = (u64)-1; in btrfs_read_locked_inode()
3639 BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item); in btrfs_read_locked_inode()
3651 if (BTRFS_I(inode)->last_trans == fs_info->generation) in btrfs_read_locked_inode()
3653 &BTRFS_I(inode)->runtime_flags); in btrfs_read_locked_inode()
3682 BTRFS_I(inode)->last_unlink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3690 if (location.objectid != btrfs_ino(BTRFS_I(inode))) in btrfs_read_locked_inode()
3698 BTRFS_I(inode)->dir_index = btrfs_inode_ref_index(leaf, ref); in btrfs_read_locked_inode()
3703 BTRFS_I(inode)->dir_index = btrfs_inode_extref_index(leaf, in btrfs_read_locked_inode()
3712 btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); in btrfs_read_locked_inode()
3719 btrfs_ino(BTRFS_I(inode)), in btrfs_read_locked_inode()
3730 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_read_locked_inode()
3767 btrfs_set_token_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size, in fill_inode_item()
3788 BTRFS_I(inode)->i_otime.tv_sec, &token); in fill_inode_item()
3790 BTRFS_I(inode)->i_otime.tv_nsec, &token); in fill_inode_item()
3794 btrfs_set_token_inode_generation(leaf, item, BTRFS_I(inode)->generation, in fill_inode_item()
3800 btrfs_set_token_inode_flags(leaf, item, BTRFS_I(inode)->flags, &token); in fill_inode_item()
3820 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location, in btrfs_update_inode_item()
3857 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) in btrfs_update_inode()
4014 struct btrfs_root *root = BTRFS_I(dir)->root; in __unlink_start_trans()
4028 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink()
4037 btrfs_record_unlink_dir(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)), in btrfs_unlink()
4040 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_unlink()
4041 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_unlink()
4047 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_unlink()
4062 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink_subvol()
4069 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); in btrfs_unlink_subvol()
4119 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); in btrfs_unlink_subvol()
4125 btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); in btrfs_unlink_subvol()
4258 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_delete_subvolume()
4260 struct btrfs_root *dest = BTRFS_I(inode)->root; in btrfs_delete_subvolume()
4310 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); in btrfs_delete_subvolume()
4394 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_rmdir()
4400 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) in btrfs_rmdir()
4407 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { in btrfs_rmdir()
4409 BTRFS_I(inode)->location.objectid, in btrfs_rmdir()
4415 err = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_rmdir()
4419 last_unlink_trans = BTRFS_I(inode)->last_unlink_trans; in btrfs_rmdir()
4422 err = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_rmdir()
4423 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_rmdir()
4426 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_rmdir()
4439 BTRFS_I(dir)->last_unlink_trans = last_unlink_trans; in btrfs_rmdir()
4513 u64 ino = btrfs_ino(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4525 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) && in btrfs_truncate_inode_items()
4541 btrfs_drop_extent_cache(BTRFS_I(inode), ALIGN(new_size, in btrfs_truncate_inode_items()
4551 if (min_type == 0 && root == BTRFS_I(inode)->root) in btrfs_truncate_inode_items()
4552 btrfs_kill_delayed_inode_items(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4607 BTRFS_I(inode), leaf, fi, in btrfs_truncate_inode_items()
4614 BTRFS_I(inode), leaf, fi, path->slots[0], in btrfs_truncate_inode_items()
4835 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_truncate_block()
4866 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize, true); in btrfs_truncate_block()
4900 clear_extent_bit(&BTRFS_I(inode)->io_tree, block_start, block_end, in btrfs_truncate_block()
4934 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize, (ret != 0)); in btrfs_truncate_block()
4954 BTRFS_I(inode)->last_trans = fs_info->generation; in maybe_insert_hole()
4955 BTRFS_I(inode)->last_sub_trans = root->log_transid; in maybe_insert_hole()
4956 BTRFS_I(inode)->last_log_commit = root->last_log_commit; in maybe_insert_hole()
4976 ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), in maybe_insert_hole()
4995 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_cont_expand()
4996 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_cont_expand()
4999 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in btrfs_cont_expand()
5024 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), hole_start, in btrfs_cont_expand()
5036 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset, in btrfs_cont_expand()
5053 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in btrfs_cont_expand()
5058 &BTRFS_I(inode)->runtime_flags); in btrfs_cont_expand()
5079 btrfs_drop_extent_cache(BTRFS_I(inode), in btrfs_cont_expand()
5100 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setsize()
5156 &BTRFS_I(inode)->runtime_flags); in btrfs_setsize()
5161 btrfs_inode_block_unlocked_dio(BTRFS_I(inode)); in btrfs_setsize()
5163 btrfs_inode_resume_unlocked_dio(BTRFS_I(inode)); in btrfs_setsize()
5178 i_size_write(inode, BTRFS_I(inode)->disk_i_size); in btrfs_setsize()
5188 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setattr()
5230 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in evict_inode_truncate_pages()
5231 struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; in evict_inode_truncate_pages()
5352 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_evict_inode()
5371 btrfs_is_free_space_inode(BTRFS_I(inode)))) in btrfs_evict_inode()
5380 btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1); in btrfs_evict_inode()
5391 ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode)); in btrfs_evict_inode()
5401 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_evict_inode()
5432 btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_evict_inode()
5439 btrfs_return_ino(root, btrfs_ino(BTRFS_I(inode))); in btrfs_evict_inode()
5449 btrfs_remove_delayed_node(BTRFS_I(inode)); in btrfs_evict_inode()
5465 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_inode_by_name()
5472 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5489 __func__, name, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5523 key.objectid = BTRFS_I(dir)->root->root_key.objectid; in fixup_tree_root_location()
5536 if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || in fixup_tree_root_location()
5566 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_add()
5570 struct rb_node *new = &BTRFS_I(inode)->rb_node; in inode_tree_add()
5571 u64 ino = btrfs_ino(BTRFS_I(inode)); in inode_tree_add()
5603 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_del()
5607 if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { in inode_tree_del()
5608 rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); in inode_tree_del()
5609 RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); in inode_tree_del()
5629 memcpy(&BTRFS_I(inode)->location, args->location, in btrfs_init_locked_inode()
5631 BTRFS_I(inode)->root = args->root; in btrfs_init_locked_inode()
5638 return args->location->objectid == BTRFS_I(inode)->location.objectid && in btrfs_find_actor()
5639 args->root == BTRFS_I(inode)->root; in btrfs_find_actor()
5705 BTRFS_I(inode)->root = root; in new_simple_dir()
5706 memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); in new_simple_dir()
5707 set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags); in new_simple_dir()
5717 BTRFS_I(inode)->i_otime = inode->i_mtime; in new_simple_dir()
5726 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_lookup_dentry()
5780 root = BTRFS_I(inode)->root; in btrfs_dentry_delete()
5784 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_dentry_delete()
5863 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_real_readdir()
5899 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_real_readdir()
6008 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_dirty_inode()
6012 if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) in btrfs_dirty_inode()
6030 if (BTRFS_I(inode)->delayed_node) in btrfs_dirty_inode()
6043 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_update_time()
6143 args.location = &BTRFS_I(inode)->location; in btrfs_insert_inode_locked()
6144 args.root = BTRFS_I(inode)->root; in btrfs_insert_inode_locked()
6147 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root), in btrfs_insert_inode_locked()
6163 flags = BTRFS_I(dir)->flags; in btrfs_inherit_iflags()
6166 BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6167 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6169 BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6170 BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6174 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; in btrfs_inherit_iflags()
6176 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_inherit_iflags()
6227 ret = btrfs_set_inode_index(BTRFS_I(dir), index); in btrfs_new_inode()
6241 BTRFS_I(inode)->index_cnt = 2; in btrfs_new_inode()
6242 BTRFS_I(inode)->dir_index = *index; in btrfs_new_inode()
6243 BTRFS_I(inode)->root = root; in btrfs_new_inode()
6244 BTRFS_I(inode)->generation = trans->transid; in btrfs_new_inode()
6245 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_new_inode()
6253 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_new_inode()
6275 location = &BTRFS_I(inode)->location; in btrfs_new_inode()
6297 BTRFS_I(inode)->i_otime = inode->i_mtime; in btrfs_new_inode()
6321 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_new_inode()
6323 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | in btrfs_new_inode()
6338 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); in btrfs_new_inode()
6346 BTRFS_I(dir)->index_cnt--; in btrfs_new_inode()
6448 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mknod()
6468 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mknod()
6489 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_mknod()
6512 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_create()
6532 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_create()
6557 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_create()
6562 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_create()
6579 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_link()
6587 if (root->objectid != BTRFS_I(inode)->root->objectid) in btrfs_link()
6593 err = btrfs_set_inode_index(BTRFS_I(dir), &index); in btrfs_link()
6611 BTRFS_I(inode)->dir_index = 0ULL; in btrfs_link()
6616 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); in btrfs_link()
6618 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_link()
6635 err = btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_link()
6640 ret = btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent, in btrfs_link()
6664 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mkdir()
6684 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mkdir()
6701 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_mkdir()
6706 err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), in btrfs_mkdir()
7153 btrfs_drop_extent_cache(BTRFS_I(inode), start, in btrfs_create_dio_extent()
7167 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_new_extent_direct()
7202 struct btrfs_root *root = BTRFS_I(inode)->root; in can_nocow_extent()
7203 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in can_nocow_extent()
7212 bool nocow = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW); in can_nocow_extent()
7219 btrfs_ino(BTRFS_I(inode)), offset, 0); in can_nocow_extent()
7235 if (key.objectid != btrfs_ino(BTRFS_I(inode)) || in can_nocow_extent()
7310 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), in can_nocow_extent()
7345 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7352 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7367 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7427 struct btrfs_root *root = BTRFS_I(inode)->root; in create_io_em()
7435 em_tree = &BTRFS_I(inode)->extent_tree; in create_io_em()
7458 btrfs_drop_extent_cache(BTRFS_I(inode), em->start, in create_io_em()
7519 ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in btrfs_get_blocks_direct_write()
7638 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0); in btrfs_get_blocks_direct()
7672 clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_get_blocks_direct()
7689 clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, in btrfs_get_blocks_direct()
7702 clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_get_blocks_direct()
7770 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in dio_read_error()
7771 struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree; in dio_read_error()
7805 btrfs_debug(BTRFS_I(inode)->root->fs_info, in dio_read_error()
7837 io_tree = &BTRFS_I(inode)->io_tree; in btrfs_retry_endio_nocsum()
7838 failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_retry_endio_nocsum()
7844 clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree, in btrfs_retry_endio_nocsum()
7846 btrfs_ino(BTRFS_I(inode)), 0); in btrfs_retry_endio_nocsum()
7866 fs_info = BTRFS_I(inode)->root->fs_info; in __btrfs_correct_data_nocsum()
7931 io_tree = &BTRFS_I(inode)->io_tree; in btrfs_retry_endio()
7932 failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_retry_endio()
7940 clean_io_failure(BTRFS_I(inode)->root->fs_info, in btrfs_retry_endio()
7943 btrfs_ino(BTRFS_I(inode)), in btrfs_retry_endio()
7972 fs_info = BTRFS_I(inode)->root->fs_info; in __btrfs_subio_endio_read()
8032 bool skip_csum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; in btrfs_subio_endio_read()
8055 unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset, in btrfs_endio_direct_read()
8081 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in __endio_write_update_ordered()
8148 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
8150 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
8223 async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_dio_bio()
8231 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_submit_dio_bio()
8447 unlock_extent(&BTRFS_I(inode)->io_tree, file_offset, in btrfs_submit_direct()
8522 &BTRFS_I(inode)->runtime_flags)) in btrfs_direct_IO()
8555 down_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8557 &BTRFS_I(inode)->runtime_flags)) { in btrfs_direct_IO()
8568 up_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8590 btrfs_delalloc_release_extents(BTRFS_I(inode), count, false); in btrfs_direct_IO()
8619 tree = &BTRFS_I(page->mapping->host)->io_tree; in btrfs_readpage()
8701 tree = &BTRFS_I(inode)->io_tree; in btrfs_invalidatepage()
8711 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), start, in btrfs_invalidatepage()
8733 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_invalidatepage()
8814 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_page_mkwrite()
8876 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8905 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end, in btrfs_page_mkwrite()
8936 BTRFS_I(inode)->last_trans = fs_info->generation; in btrfs_page_mkwrite()
8937 BTRFS_I(inode)->last_sub_trans = BTRFS_I(inode)->root->log_transid; in btrfs_page_mkwrite()
8938 BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->root->last_log_commit; in btrfs_page_mkwrite()
8943 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); in btrfs_page_mkwrite()
8952 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0)); in btrfs_page_mkwrite()
8964 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_truncate()
9034 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_truncate()
9128 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_create_subvol_root()
9204 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_test_destroy_inode()
9205 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_test_destroy_inode()
9212 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_i_callback()
9219 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_destroy_inode()
9223 WARN_ON(BTRFS_I(inode)->block_rsv.reserved); in btrfs_destroy_inode()
9224 WARN_ON(BTRFS_I(inode)->block_rsv.size); in btrfs_destroy_inode()
9225 WARN_ON(BTRFS_I(inode)->outstanding_extents); in btrfs_destroy_inode()
9226 WARN_ON(BTRFS_I(inode)->delalloc_bytes); in btrfs_destroy_inode()
9227 WARN_ON(BTRFS_I(inode)->new_delalloc_bytes); in btrfs_destroy_inode()
9228 WARN_ON(BTRFS_I(inode)->csum_bytes); in btrfs_destroy_inode()
9229 WARN_ON(BTRFS_I(inode)->defrag_bytes); in btrfs_destroy_inode()
9254 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_destroy_inode()
9261 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_drop_inode()
9332 u32 bi_flags = BTRFS_I(inode)->flags; in btrfs_getattr()
9335 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec; in btrfs_getattr()
9336 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec; in btrfs_getattr()
9352 stat->dev = BTRFS_I(inode)->root->anon_dev; in btrfs_getattr()
9354 spin_lock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9355 delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes; in btrfs_getattr()
9356 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9369 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename_exchange()
9370 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename_exchange()
9375 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename_exchange()
9376 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); in btrfs_rename_exchange()
9420 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &old_idx); in btrfs_rename_exchange()
9423 ret = btrfs_set_inode_index(BTRFS_I(old_dir), &new_idx); in btrfs_rename_exchange()
9427 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9428 BTRFS_I(new_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9441 btrfs_ino(BTRFS_I(new_dir)), in btrfs_rename_exchange()
9458 btrfs_ino(BTRFS_I(old_dir)), in btrfs_rename_exchange()
9475 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9476 BTRFS_I(old_inode), 1); in btrfs_rename_exchange()
9477 btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9478 BTRFS_I(new_inode), 1); in btrfs_rename_exchange()
9483 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; in btrfs_rename_exchange()
9488 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename_exchange()
9489 BTRFS_I(old_dentry->d_inode), in btrfs_rename_exchange()
9502 root_objectid = BTRFS_I(new_inode)->root->root_key.objectid; in btrfs_rename_exchange()
9507 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename_exchange()
9508 BTRFS_I(new_dentry->d_inode), in btrfs_rename_exchange()
9519 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename_exchange()
9527 ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode), in btrfs_rename_exchange()
9536 BTRFS_I(old_inode)->dir_index = old_idx; in btrfs_rename_exchange()
9538 BTRFS_I(new_inode)->dir_index = new_idx; in btrfs_rename_exchange()
9542 ret = btrfs_log_new_name(trans, BTRFS_I(old_inode), in btrfs_rename_exchange()
9543 BTRFS_I(old_dir), parent, in btrfs_rename_exchange()
9556 ret = btrfs_log_new_name(trans, BTRFS_I(new_inode), in btrfs_rename_exchange()
9557 BTRFS_I(new_dir), parent, in btrfs_rename_exchange()
9581 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename_exchange()
9582 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename_exchange()
9583 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename_exchange()
9585 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename_exchange()
9598 ret = btrfs_sync_log(trans, BTRFS_I(old_inode)->root, in btrfs_rename_exchange()
9604 ret = btrfs_sync_log(trans, BTRFS_I(new_inode)->root, in btrfs_rename_exchange()
9643 btrfs_ino(BTRFS_I(dir)), in btrfs_whiteout_for_rename()
9662 ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_whiteout_for_rename()
9663 BTRFS_I(inode), 0, index); in btrfs_whiteout_for_rename()
9684 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename()
9685 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename()
9691 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename()
9697 if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_rename()
9705 (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) in btrfs_rename()
9765 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index); in btrfs_rename()
9769 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename()
9780 btrfs_ino(BTRFS_I(new_dir)), index); in btrfs_rename()
9793 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename()
9794 BTRFS_I(old_inode), 1); in btrfs_rename()
9797 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; in btrfs_rename()
9802 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename()
9803 BTRFS_I(d_inode(old_dentry)), in btrfs_rename()
9817 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == in btrfs_rename()
9819 root_objectid = BTRFS_I(new_inode)->location.objectid; in btrfs_rename()
9825 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename()
9826 BTRFS_I(d_inode(new_dentry)), in btrfs_rename()
9832 BTRFS_I(d_inode(new_dentry))); in btrfs_rename()
9839 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename()
9848 BTRFS_I(old_inode)->dir_index = index; in btrfs_rename()
9854 ret = btrfs_log_new_name(trans, BTRFS_I(old_inode), in btrfs_rename()
9855 BTRFS_I(old_dir), parent, in btrfs_rename()
9888 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename()
9889 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename()
9890 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename()
9892 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename()
9899 ret = btrfs_sync_log(trans, BTRFS_I(old_inode)->root, &ctx); in btrfs_rename()
9949 &BTRFS_I(inode)->runtime_flags)) in btrfs_run_delalloc_work()
10105 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_symlink()
10138 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), in btrfs_symlink()
10155 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_symlink()
10166 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_symlink()
10196 btrfs_i_size_write(BTRFS_I(inode), name_len); in btrfs_symlink()
10204 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_symlink()
10205 BTRFS_I(inode), 0, index); in btrfs_symlink()
10227 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in __btrfs_prealloc_file_range()
10229 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_prealloc_file_range()
10283 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10289 &BTRFS_I(inode)->runtime_flags); in __btrfs_prealloc_file_range()
10310 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10322 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; in __btrfs_prealloc_file_range()
10377 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_permission()
10384 if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) in btrfs_permission()
10394 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_tmpfile()
10412 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_tmpfile()
10423 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_tmpfile()
10432 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_tmpfile()
10469 btrfs_debug_rl(BTRFS_I(inode)->root->fs_info, in btrfs_check_extent_io_range()
10471 caller, btrfs_ino(BTRFS_I(inode)), isize, start, end); in btrfs_check_extent_io_range()