Lines Matching refs:BTRFS_I
145 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_test_inode_set_ops()
194 key.objectid = btrfs_ino(BTRFS_I(inode)); in insert_inline_extent()
255 BTRFS_I(inode)->disk_i_size = inode->i_size; in insert_inline_extent()
273 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range_inline()
308 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in cow_file_range_inline()
339 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in cow_file_range_inline()
340 btrfs_drop_extent_cache(BTRFS_I(inode), start, aligned_end - 1, 0); in cow_file_range_inline()
407 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW || in inode_can_compress()
408 BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in inode_can_compress()
424 btrfs_ino(BTRFS_I(inode))); in inode_need_compress()
431 if (BTRFS_I(inode)->defrag_compress) in inode_need_compress()
434 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS) in inode_need_compress()
437 BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS || in inode_need_compress()
438 BTRFS_I(inode)->prop_compress) in inode_need_compress()
489 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
532 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
554 if (BTRFS_I(inode)->defrag_compress) in compress_file_range()
555 compress_type = BTRFS_I(inode)->defrag_compress; in compress_file_range()
556 else if (BTRFS_I(inode)->prop_compress) in compress_file_range()
557 compress_type = BTRFS_I(inode)->prop_compress; in compress_file_range()
704 !(BTRFS_I(inode)->prop_compress)) { in compress_file_range()
705 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in compress_file_range()
759 struct btrfs_root *root = BTRFS_I(inode)->root; in submit_compressed_extents()
760 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in submit_compressed_extents()
858 btrfs_drop_extent_cache(BTRFS_I(inode), in submit_compressed_extents()
922 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in get_extent_allocation_hint()
970 struct btrfs_root *root = BTRFS_I(inode)->root; in cow_file_range()
983 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in cow_file_range()
993 inode_should_defrag(BTRFS_I(inode), start, end, num_bytes, SZ_64K); in cow_file_range()
1022 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1071 btrfs_drop_extent_cache(BTRFS_I(inode), start, in cow_file_range()
1112 btrfs_drop_extent_cache(BTRFS_I(inode), start, start + ram_size - 1, 0); in cow_file_range()
1222 unlock_extent(&BTRFS_I(inode)->io_tree, start, end); in cow_file_range_async()
1224 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS && in cow_file_range_async()
1324 struct btrfs_root *root = BTRFS_I(inode)->root; in run_delalloc_nocow()
1330 const bool freespace_inode = btrfs_is_free_space_inode(BTRFS_I(inode)); in run_delalloc_nocow()
1331 u64 ino = btrfs_ino(BTRFS_I(inode)); in run_delalloc_nocow()
1593 btrfs_drop_extent_cache(BTRFS_I(inode), in run_delalloc_nocow()
1673 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in need_force_cow()
1674 !(BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC)) in need_force_cow()
1682 if (BTRFS_I(inode)->defrag_bytes && in need_force_cow()
1683 test_range_bit(&BTRFS_I(inode)->io_tree, start, end, in need_force_cow()
1702 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW && !force_cow) { in btrfs_run_delalloc_range()
1705 } else if (BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC && !force_cow) { in btrfs_run_delalloc_range()
1714 &BTRFS_I(inode)->runtime_flags); in btrfs_run_delalloc_range()
1751 spin_lock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
1752 btrfs_mod_outstanding_extents(BTRFS_I(inode), 1); in btrfs_split_delalloc_extent()
1753 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
1778 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1779 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
1780 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1809 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1810 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
1811 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1820 if (list_empty(&BTRFS_I(inode)->delalloc_inodes)) { in btrfs_add_delalloc_inodes()
1821 list_add_tail(&BTRFS_I(inode)->delalloc_inodes, in btrfs_add_delalloc_inodes()
1824 &BTRFS_I(inode)->runtime_flags); in btrfs_add_delalloc_inodes()
1883 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_set_delalloc_extent()
1886 bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_set_delalloc_extent()
1888 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1889 btrfs_mod_outstanding_extents(BTRFS_I(inode), num_extents); in btrfs_set_delalloc_extent()
1890 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1898 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1899 BTRFS_I(inode)->delalloc_bytes += len; in btrfs_set_delalloc_extent()
1901 BTRFS_I(inode)->defrag_bytes += len; in btrfs_set_delalloc_extent()
1903 &BTRFS_I(inode)->runtime_flags)) in btrfs_set_delalloc_extent()
1905 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1910 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1911 BTRFS_I(inode)->new_delalloc_bytes += state->end + 1 - in btrfs_set_delalloc_extent()
1913 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
1924 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_clear_delalloc_extent()
2071 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_submit_bio_hook()
2075 int async = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_bio_hook()
2077 skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; in btrfs_submit_bio_hook()
2079 if (btrfs_is_free_space_inode(BTRFS_I(inode))) in btrfs_submit_bio_hook()
2136 BTRFS_I(inode)->root->fs_info->csum_root, sum); in add_pending_csums()
2149 return set_extent_delalloc(&BTRFS_I(inode)->io_tree, start, end, in btrfs_set_extent_delalloc()
2184 lock_extent_bits(&BTRFS_I(inode)->io_tree, page_start, page_end, in btrfs_writepage_fixup_worker()
2191 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_writepage_fixup_worker()
2194 unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, in btrfs_writepage_fixup_worker()
2222 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_writepage_fixup_worker()
2224 unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end, in btrfs_writepage_fixup_worker()
2277 struct btrfs_root *root = BTRFS_I(inode)->root; in insert_reserved_file_extent()
2306 ins.objectid = btrfs_ino(BTRFS_I(inode)); in insert_reserved_file_extent()
2348 btrfs_ino(BTRFS_I(inode)), in insert_reserved_file_extent()
2468 if (BTRFS_I(inode)->root->root_key.objectid == root_id && in record_one_backref()
2469 inum == btrfs_ino(BTRFS_I(inode))) in record_one_backref()
2689 lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, lock_end, in relink_extent_backref()
2739 key.objectid = btrfs_ino(BTRFS_I(inode)); in relink_extent_backref()
2818 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, lock_end, in relink_extent_backref()
2890 struct btrfs_root *root = BTRFS_I(inode)->root; in record_old_file_extents()
2914 key.objectid = btrfs_ino(BTRFS_I(inode)); in record_old_file_extents()
2949 if (key.objectid != btrfs_ino(BTRFS_I(inode))) in record_old_file_extents()
3022 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_finish_ordered_io()
3024 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_finish_ordered_io()
3041 nolock = btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_finish_ordered_io()
3048 btrfs_free_io_failure_record(BTRFS_I(inode), in btrfs_finish_ordered_io()
3081 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
3098 if (0 && last_snapshot >= BTRFS_I(inode)->generation) in btrfs_finish_ordered_io()
3117 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
3125 ret = btrfs_mark_extent_written(trans, BTRFS_I(inode), in btrfs_finish_ordered_io()
3145 unpin_extent_cache(&BTRFS_I(inode)->extent_tree, in btrfs_finish_ordered_io()
3174 clear_extent_bit(&BTRFS_I(inode)->io_tree, in btrfs_finish_ordered_io()
3197 btrfs_drop_extent_cache(BTRFS_I(inode), start, end, 0); in btrfs_finish_ordered_io()
3266 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in btrfs_writepage_endio_finish_ordered()
3306 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in __readpage_endio_check()
3325 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_readpage_end_io_hook()
3326 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_readpage_end_io_hook()
3333 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_readpage_end_io_hook()
3360 struct btrfs_inode *binode = BTRFS_I(inode); in btrfs_add_delayed_iput()
3715 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_read_locked_inode()
3734 memcpy(&location, &BTRFS_I(inode)->location, sizeof(location)); in btrfs_read_locked_inode()
3754 btrfs_i_size_write(BTRFS_I(inode), btrfs_inode_size(leaf, inode_item)); in btrfs_read_locked_inode()
3765 BTRFS_I(inode)->i_otime.tv_sec = in btrfs_read_locked_inode()
3767 BTRFS_I(inode)->i_otime.tv_nsec = in btrfs_read_locked_inode()
3771 BTRFS_I(inode)->generation = btrfs_inode_generation(leaf, inode_item); in btrfs_read_locked_inode()
3772 BTRFS_I(inode)->last_trans = btrfs_inode_transid(leaf, inode_item); in btrfs_read_locked_inode()
3776 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_read_locked_inode()
3780 BTRFS_I(inode)->index_cnt = (u64)-1; in btrfs_read_locked_inode()
3781 BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item); in btrfs_read_locked_inode()
3793 if (BTRFS_I(inode)->last_trans == fs_info->generation) in btrfs_read_locked_inode()
3795 &BTRFS_I(inode)->runtime_flags); in btrfs_read_locked_inode()
3824 BTRFS_I(inode)->last_unlink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3832 if (location.objectid != btrfs_ino(BTRFS_I(inode))) in btrfs_read_locked_inode()
3840 BTRFS_I(inode)->dir_index = btrfs_inode_ref_index(leaf, ref); in btrfs_read_locked_inode()
3845 BTRFS_I(inode)->dir_index = btrfs_inode_extref_index(leaf, in btrfs_read_locked_inode()
3854 btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); in btrfs_read_locked_inode()
3861 btrfs_ino(BTRFS_I(inode)), in btrfs_read_locked_inode()
3873 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_read_locked_inode()
3910 btrfs_set_token_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size, in fill_inode_item()
3931 BTRFS_I(inode)->i_otime.tv_sec, &token); in fill_inode_item()
3933 BTRFS_I(inode)->i_otime.tv_nsec, &token); in fill_inode_item()
3937 btrfs_set_token_inode_generation(leaf, item, BTRFS_I(inode)->generation, in fill_inode_item()
3943 btrfs_set_token_inode_flags(leaf, item, BTRFS_I(inode)->flags, &token); in fill_inode_item()
3963 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location, in btrfs_update_inode_item()
4000 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) in btrfs_update_inode()
4160 struct btrfs_root *root = BTRFS_I(dir)->root; in __unlink_start_trans()
4174 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink()
4183 btrfs_record_unlink_dir(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)), in btrfs_unlink()
4186 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_unlink()
4187 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_unlink()
4193 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_unlink()
4208 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink_subvol()
4215 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); in btrfs_unlink_subvol()
4262 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); in btrfs_unlink_subvol()
4268 btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); in btrfs_unlink_subvol()
4401 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_delete_subvolume()
4403 struct btrfs_root *dest = BTRFS_I(inode)->root; in btrfs_delete_subvolume()
4452 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); in btrfs_delete_subvolume()
4536 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_rmdir()
4542 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) in btrfs_rmdir()
4549 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { in btrfs_rmdir()
4551 BTRFS_I(inode)->location.objectid, in btrfs_rmdir()
4557 err = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_rmdir()
4561 last_unlink_trans = BTRFS_I(inode)->last_unlink_trans; in btrfs_rmdir()
4564 err = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_rmdir()
4565 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_rmdir()
4568 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_rmdir()
4581 BTRFS_I(dir)->last_unlink_trans = last_unlink_trans; in btrfs_rmdir()
4630 u64 ino = btrfs_ino(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4641 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) && in btrfs_truncate_inode_items()
4657 btrfs_drop_extent_cache(BTRFS_I(inode), ALIGN(new_size, in btrfs_truncate_inode_items()
4667 if (min_type == 0 && root == BTRFS_I(inode)->root) in btrfs_truncate_inode_items()
4668 btrfs_kill_delayed_inode_items(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4723 BTRFS_I(inode), leaf, fi, in btrfs_truncate_inode_items()
4730 BTRFS_I(inode), leaf, fi, path->slots[0], in btrfs_truncate_inode_items()
4936 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_truncate_block()
4967 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize); in btrfs_truncate_block()
5001 clear_extent_bit(&BTRFS_I(inode)->io_tree, block_start, block_end, in btrfs_truncate_block()
5034 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize); in btrfs_truncate_block()
5054 BTRFS_I(inode)->last_trans = fs_info->generation; in maybe_insert_hole()
5055 BTRFS_I(inode)->last_sub_trans = root->log_transid; in maybe_insert_hole()
5056 BTRFS_I(inode)->last_log_commit = root->last_log_commit; in maybe_insert_hole()
5076 ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), in maybe_insert_hole()
5095 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_cont_expand()
5096 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_cont_expand()
5099 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in btrfs_cont_expand()
5119 btrfs_lock_and_flush_ordered_range(io_tree, BTRFS_I(inode), hole_start, in btrfs_cont_expand()
5123 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset, in btrfs_cont_expand()
5140 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in btrfs_cont_expand()
5145 &BTRFS_I(inode)->runtime_flags); in btrfs_cont_expand()
5166 btrfs_drop_extent_cache(BTRFS_I(inode), in btrfs_cont_expand()
5187 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setsize()
5243 &BTRFS_I(inode)->runtime_flags); in btrfs_setsize()
5248 btrfs_inode_block_unlocked_dio(BTRFS_I(inode)); in btrfs_setsize()
5250 btrfs_inode_resume_unlocked_dio(BTRFS_I(inode)); in btrfs_setsize()
5265 i_size_write(inode, BTRFS_I(inode)->disk_i_size); in btrfs_setsize()
5275 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setattr()
5317 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in evict_inode_truncate_pages()
5318 struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; in evict_inode_truncate_pages()
5452 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_evict_inode()
5468 btrfs_is_free_space_inode(BTRFS_I(inode)))) in btrfs_evict_inode()
5474 btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1); in btrfs_evict_inode()
5485 ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode)); in btrfs_evict_inode()
5495 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_evict_inode()
5526 btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_evict_inode()
5533 btrfs_return_ino(root, btrfs_ino(BTRFS_I(inode))); in btrfs_evict_inode()
5543 btrfs_remove_delayed_node(BTRFS_I(inode)); in btrfs_evict_inode()
5561 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_inode_by_name()
5568 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5581 __func__, name, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5617 key.objectid = BTRFS_I(dir)->root->root_key.objectid; in fixup_tree_root_location()
5630 if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || in fixup_tree_root_location()
5660 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_add()
5664 struct rb_node *new = &BTRFS_I(inode)->rb_node; in inode_tree_add()
5665 u64 ino = btrfs_ino(BTRFS_I(inode)); in inode_tree_add()
5697 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_del()
5701 if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { in inode_tree_del()
5702 rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); in inode_tree_del()
5703 RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); in inode_tree_del()
5723 memcpy(&BTRFS_I(inode)->location, args->location, in btrfs_init_locked_inode()
5725 BTRFS_I(inode)->root = args->root; in btrfs_init_locked_inode()
5732 return args->location->objectid == BTRFS_I(inode)->location.objectid && in btrfs_find_actor()
5733 args->root == BTRFS_I(inode)->root; in btrfs_find_actor()
5806 BTRFS_I(inode)->root = root; in new_simple_dir()
5807 memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); in new_simple_dir()
5808 set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags); in new_simple_dir()
5818 BTRFS_I(inode)->i_otime = inode->i_mtime; in new_simple_dir()
5845 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_lookup_dentry()
5912 root = BTRFS_I(inode)->root; in btrfs_dentry_delete()
5916 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_dentry_delete()
5985 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_real_readdir()
6021 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_real_readdir()
6130 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_dirty_inode()
6134 if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) in btrfs_dirty_inode()
6152 if (BTRFS_I(inode)->delayed_node) in btrfs_dirty_inode()
6165 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_update_time()
6265 args.location = &BTRFS_I(inode)->location; in btrfs_insert_inode_locked()
6266 args.root = BTRFS_I(inode)->root; in btrfs_insert_inode_locked()
6269 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root), in btrfs_insert_inode_locked()
6285 flags = BTRFS_I(dir)->flags; in btrfs_inherit_iflags()
6288 BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6289 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6291 BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6292 BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6296 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; in btrfs_inherit_iflags()
6298 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_inherit_iflags()
6352 ret = btrfs_set_inode_index(BTRFS_I(dir), index); in btrfs_new_inode()
6366 BTRFS_I(inode)->index_cnt = 2; in btrfs_new_inode()
6367 BTRFS_I(inode)->dir_index = *index; in btrfs_new_inode()
6368 BTRFS_I(inode)->root = root; in btrfs_new_inode()
6369 BTRFS_I(inode)->generation = trans->transid; in btrfs_new_inode()
6370 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_new_inode()
6378 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_new_inode()
6400 location = &BTRFS_I(inode)->location; in btrfs_new_inode()
6422 BTRFS_I(inode)->i_otime = inode->i_mtime; in btrfs_new_inode()
6446 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_new_inode()
6448 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | in btrfs_new_inode()
6463 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); in btrfs_new_inode()
6471 BTRFS_I(dir)->index_cnt--; in btrfs_new_inode()
6582 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mknod()
6602 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mknod()
6623 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_mknod()
6646 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_create()
6666 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_create()
6691 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_create()
6696 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_create()
6713 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_link()
6721 if (root->root_key.objectid != BTRFS_I(inode)->root->root_key.objectid) in btrfs_link()
6727 err = btrfs_set_inode_index(BTRFS_I(dir), &index); in btrfs_link()
6745 BTRFS_I(inode)->dir_index = 0ULL; in btrfs_link()
6750 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); in btrfs_link()
6752 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_link()
6769 err = btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_link()
6774 ret = btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent, in btrfs_link()
6798 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mkdir()
6817 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mkdir()
6833 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_mkdir()
6838 err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), in btrfs_mkdir()
7296 btrfs_drop_extent_cache(BTRFS_I(inode), start, in btrfs_create_dio_extent()
7310 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_new_extent_direct()
7345 struct btrfs_root *root = BTRFS_I(inode)->root; in can_nocow_extent()
7346 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in can_nocow_extent()
7355 bool nocow = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW); in can_nocow_extent()
7362 btrfs_ino(BTRFS_I(inode)), offset, 0); in can_nocow_extent()
7378 if (key.objectid != btrfs_ino(BTRFS_I(inode)) || in can_nocow_extent()
7453 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), in can_nocow_extent()
7488 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7495 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7510 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7570 struct btrfs_root *root = BTRFS_I(inode)->root; in create_io_em()
7578 em_tree = &BTRFS_I(inode)->extent_tree; in create_io_em()
7601 btrfs_drop_extent_cache(BTRFS_I(inode), em->start, in create_io_em()
7662 ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in btrfs_get_blocks_direct_write()
7778 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0); in btrfs_get_blocks_direct()
7811 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, in btrfs_get_blocks_direct()
7828 unlock_extent_cached(&BTRFS_I(inode)->io_tree, in btrfs_get_blocks_direct()
7840 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_get_blocks_direct()
7908 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in dio_read_error()
7909 struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree; in dio_read_error()
7943 btrfs_debug(BTRFS_I(inode)->root->fs_info, in dio_read_error()
7975 io_tree = &BTRFS_I(inode)->io_tree; in btrfs_retry_endio_nocsum()
7976 failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_retry_endio_nocsum()
7982 clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree, in btrfs_retry_endio_nocsum()
7984 btrfs_ino(BTRFS_I(inode)), 0); in btrfs_retry_endio_nocsum()
8004 fs_info = BTRFS_I(inode)->root->fs_info; in __btrfs_correct_data_nocsum()
8070 io_tree = &BTRFS_I(inode)->io_tree; in btrfs_retry_endio()
8071 failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_retry_endio()
8079 clean_io_failure(BTRFS_I(inode)->root->fs_info, in btrfs_retry_endio()
8082 btrfs_ino(BTRFS_I(inode)), in btrfs_retry_endio()
8112 fs_info = BTRFS_I(inode)->root->fs_info; in __btrfs_subio_endio_read()
8172 bool skip_csum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; in btrfs_subio_endio_read()
8195 unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset, in btrfs_endio_direct_read()
8219 if (btrfs_is_free_space_inode(BTRFS_I(inode))) { in __endio_write_update_ordered()
8286 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
8288 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
8361 async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_dio_bio()
8369 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_submit_dio_bio()
8582 unlock_extent(&BTRFS_I(inode)->io_tree, file_offset, in btrfs_submit_direct()
8657 &BTRFS_I(inode)->runtime_flags)) in btrfs_direct_IO()
8690 down_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8692 &BTRFS_I(inode)->runtime_flags)) { in btrfs_direct_IO()
8703 up_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8725 btrfs_delalloc_release_extents(BTRFS_I(inode), count); in btrfs_direct_IO()
8754 tree = &BTRFS_I(page->mapping->host)->io_tree; in btrfs_readpage()
8836 tree = &BTRFS_I(inode)->io_tree; in btrfs_invalidatepage()
8846 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), start, in btrfs_invalidatepage()
8867 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_invalidatepage()
8947 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_page_mkwrite()
9009 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
9038 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end, in btrfs_page_mkwrite()
9068 BTRFS_I(inode)->last_trans = fs_info->generation; in btrfs_page_mkwrite()
9069 BTRFS_I(inode)->last_sub_trans = BTRFS_I(inode)->root->log_transid; in btrfs_page_mkwrite()
9070 BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->root->last_log_commit; in btrfs_page_mkwrite()
9075 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
9084 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
9096 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_truncate()
9166 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_truncate()
9260 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_create_subvol_root()
9337 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_test_destroy_inode()
9338 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_test_destroy_inode()
9344 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_free_inode()
9351 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_destroy_inode()
9355 WARN_ON(BTRFS_I(inode)->block_rsv.reserved); in btrfs_destroy_inode()
9356 WARN_ON(BTRFS_I(inode)->block_rsv.size); in btrfs_destroy_inode()
9357 WARN_ON(BTRFS_I(inode)->outstanding_extents); in btrfs_destroy_inode()
9358 WARN_ON(BTRFS_I(inode)->delalloc_bytes); in btrfs_destroy_inode()
9359 WARN_ON(BTRFS_I(inode)->new_delalloc_bytes); in btrfs_destroy_inode()
9360 WARN_ON(BTRFS_I(inode)->csum_bytes); in btrfs_destroy_inode()
9361 WARN_ON(BTRFS_I(inode)->defrag_bytes); in btrfs_destroy_inode()
9386 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_destroy_inode()
9391 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_drop_inode()
9469 u32 bi_flags = BTRFS_I(inode)->flags; in btrfs_getattr()
9472 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec; in btrfs_getattr()
9473 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec; in btrfs_getattr()
9489 stat->dev = BTRFS_I(inode)->root->anon_dev; in btrfs_getattr()
9491 spin_lock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9492 delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes; in btrfs_getattr()
9493 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9506 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename_exchange()
9507 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename_exchange()
9512 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename_exchange()
9513 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); in btrfs_rename_exchange()
9557 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &old_idx); in btrfs_rename_exchange()
9560 ret = btrfs_set_inode_index(BTRFS_I(old_dir), &new_idx); in btrfs_rename_exchange()
9564 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9565 BTRFS_I(new_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9578 btrfs_ino(BTRFS_I(new_dir)), in btrfs_rename_exchange()
9595 btrfs_ino(BTRFS_I(old_dir)), in btrfs_rename_exchange()
9612 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9613 BTRFS_I(old_inode), 1); in btrfs_rename_exchange()
9614 btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9615 BTRFS_I(new_inode), 1); in btrfs_rename_exchange()
9620 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; in btrfs_rename_exchange()
9625 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename_exchange()
9626 BTRFS_I(old_dentry->d_inode), in btrfs_rename_exchange()
9639 root_objectid = BTRFS_I(new_inode)->root->root_key.objectid; in btrfs_rename_exchange()
9644 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename_exchange()
9645 BTRFS_I(new_dentry->d_inode), in btrfs_rename_exchange()
9656 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename_exchange()
9664 ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode), in btrfs_rename_exchange()
9673 BTRFS_I(old_inode)->dir_index = old_idx; in btrfs_rename_exchange()
9675 BTRFS_I(new_inode)->dir_index = new_idx; in btrfs_rename_exchange()
9679 ret = btrfs_log_new_name(trans, BTRFS_I(old_inode), in btrfs_rename_exchange()
9680 BTRFS_I(old_dir), parent, in btrfs_rename_exchange()
9693 ret = btrfs_log_new_name(trans, BTRFS_I(new_inode), in btrfs_rename_exchange()
9694 BTRFS_I(new_dir), parent, in btrfs_rename_exchange()
9718 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename_exchange()
9719 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename_exchange()
9720 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename_exchange()
9722 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename_exchange()
9735 ret = btrfs_sync_log(trans, BTRFS_I(old_inode)->root, in btrfs_rename_exchange()
9741 ret = btrfs_sync_log(trans, BTRFS_I(new_inode)->root, in btrfs_rename_exchange()
9795 btrfs_ino(BTRFS_I(dir)), in btrfs_whiteout_for_rename()
9814 ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_whiteout_for_rename()
9815 BTRFS_I(inode), 0, index); in btrfs_whiteout_for_rename()
9836 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename()
9837 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename()
9843 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename()
9849 if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_rename()
9857 (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) in btrfs_rename()
9917 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index); in btrfs_rename()
9921 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename()
9932 btrfs_ino(BTRFS_I(new_dir)), index); in btrfs_rename()
9945 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename()
9946 BTRFS_I(old_inode), 1); in btrfs_rename()
9949 root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; in btrfs_rename()
9954 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename()
9955 BTRFS_I(d_inode(old_dentry)), in btrfs_rename()
9969 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == in btrfs_rename()
9971 root_objectid = BTRFS_I(new_inode)->location.objectid; in btrfs_rename()
9977 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename()
9978 BTRFS_I(d_inode(new_dentry)), in btrfs_rename()
9984 BTRFS_I(d_inode(new_dentry))); in btrfs_rename()
9991 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename()
10000 BTRFS_I(old_inode)->dir_index = index; in btrfs_rename()
10006 ret = btrfs_log_new_name(trans, BTRFS_I(old_inode), in btrfs_rename()
10007 BTRFS_I(old_dir), parent, in btrfs_rename()
10040 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename()
10041 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename()
10042 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename()
10044 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename()
10051 ret = btrfs_sync_log(trans, BTRFS_I(old_inode)->root, &ctx); in btrfs_rename()
10101 &BTRFS_I(inode)->runtime_flags)) in btrfs_run_delalloc_work()
10259 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_symlink()
10292 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), in btrfs_symlink()
10309 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_symlink()
10320 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_symlink()
10349 btrfs_i_size_write(BTRFS_I(inode), name_len); in btrfs_symlink()
10357 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_symlink()
10358 BTRFS_I(inode), 0, index); in btrfs_symlink()
10380 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in __btrfs_prealloc_file_range()
10382 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_prealloc_file_range()
10436 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10442 &BTRFS_I(inode)->runtime_flags); in __btrfs_prealloc_file_range()
10463 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10475 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; in __btrfs_prealloc_file_range()
10530 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_permission()
10537 if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) in btrfs_permission()
10547 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_tmpfile()
10565 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_tmpfile()
10576 BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; in btrfs_tmpfile()
10585 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_tmpfile()
10633 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_add_swapfile_pin()
10671 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_free_swapfile_pins()
10737 atomic_dec(&BTRFS_I(inode)->root->nr_swapfiles); in btrfs_swap_deactivate()
10744 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_swap_activate()
10745 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_swap_activate()
10768 if (BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS) { in btrfs_swap_activate()
10772 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW)) { in btrfs_swap_activate()
10776 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) { in btrfs_swap_activate()
10801 atomic_inc(&BTRFS_I(inode)->root->nr_swapfiles); in btrfs_swap_activate()
10812 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0); in btrfs_swap_activate()