Lines Matching refs:BTRFS_I

188 		key.objectid = btrfs_ino(BTRFS_I(inode));  in insert_inline_extent()
245 ret = btrfs_inode_set_file_extent_range(BTRFS_I(inode), start, size); in insert_inline_extent()
258 BTRFS_I(inode)->disk_i_size = inode->i_size; in insert_inline_extent()
494 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
537 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
550 if (inode_need_compress(BTRFS_I(inode), start, end)) { in compress_file_range()
559 if (BTRFS_I(inode)->defrag_compress) in compress_file_range()
560 compress_type = BTRFS_I(inode)->defrag_compress; in compress_file_range()
561 else if (BTRFS_I(inode)->prop_compress) in compress_file_range()
562 compress_type = BTRFS_I(inode)->prop_compress; in compress_file_range()
614 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
619 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
641 extent_clear_unlock_delalloc(BTRFS_I(inode), start, end, in compress_file_range()
717 !(BTRFS_I(inode)->prop_compress)) { in compress_file_range()
718 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in compress_file_range()
768 struct btrfs_inode *inode = BTRFS_I(async_chunk->inode); in submit_compressed_extents()
1869 spin_lock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
1870 btrfs_mod_outstanding_extents(BTRFS_I(inode), 1); in btrfs_split_delalloc_extent()
1871 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
1896 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1897 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
1898 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1927 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1928 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
1929 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
1938 if (list_empty(&BTRFS_I(inode)->delalloc_inodes)) { in btrfs_add_delalloc_inodes()
1939 list_add_tail(&BTRFS_I(inode)->delalloc_inodes, in btrfs_add_delalloc_inodes()
1942 &BTRFS_I(inode)->runtime_flags); in btrfs_add_delalloc_inodes()
2001 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_set_delalloc_extent()
2004 bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_set_delalloc_extent()
2006 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2007 btrfs_mod_outstanding_extents(BTRFS_I(inode), num_extents); in btrfs_set_delalloc_extent()
2008 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2016 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2017 BTRFS_I(inode)->delalloc_bytes += len; in btrfs_set_delalloc_extent()
2019 BTRFS_I(inode)->defrag_bytes += len; in btrfs_set_delalloc_extent()
2021 &BTRFS_I(inode)->runtime_flags)) in btrfs_set_delalloc_extent()
2023 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2028 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2029 BTRFS_I(inode)->new_delalloc_bytes += state->end + 1 - in btrfs_set_delalloc_extent()
2031 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2042 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_clear_delalloc_extent()
2157 return btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_bio_start()
2183 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_submit_data_bio()
2187 int async = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_data_bio()
2189 skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; in btrfs_submit_data_bio()
2191 if (btrfs_is_free_space_inode(BTRFS_I(inode))) in btrfs_submit_data_bio()
2219 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_data_bio()
2344 inode = BTRFS_I(fixup->inode); in btrfs_writepage_fixup_worker()
2618 return insert_reserved_file_extent(trans, BTRFS_I(oe->inode), in insert_ordered_extent_file_extent()
2632 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_finish_ordered_io()
2634 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_finish_ordered_io()
2655 freespace_inode = btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_finish_ordered_io()
2662 btrfs_free_io_failure_record(BTRFS_I(inode), start, end); in btrfs_finish_ordered_io()
2685 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
2705 trans->block_rsv = &BTRFS_I(inode)->block_rsv; in btrfs_finish_ordered_io()
2711 ret = btrfs_mark_extent_written(trans, BTRFS_I(inode), in btrfs_finish_ordered_io()
2725 unpin_extent_cache(&BTRFS_I(inode)->extent_tree, in btrfs_finish_ordered_io()
2752 clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, clear_bits, in btrfs_finish_ordered_io()
2779 btrfs_drop_extent_cache(BTRFS_I(inode), unwritten_start, end, 0); in btrfs_finish_ordered_io()
2814 btrfs_remove_ordered_extent(BTRFS_I(inode), ordered_extent); in btrfs_finish_ordered_io()
2834 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_writepage_endio_finish_ordered()
2879 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in check_data_csum()
2900 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_verify_data_csum()
2901 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_verify_data_csum()
2908 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_verify_data_csum()
2935 struct btrfs_inode *binode = BTRFS_I(inode); in btrfs_add_delayed_iput()
3288 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_read_locked_inode()
3307 memcpy(&location, &BTRFS_I(inode)->location, sizeof(location)); in btrfs_read_locked_inode()
3327 btrfs_i_size_write(BTRFS_I(inode), btrfs_inode_size(leaf, inode_item)); in btrfs_read_locked_inode()
3328 btrfs_inode_set_file_extent_range(BTRFS_I(inode), 0, in btrfs_read_locked_inode()
3340 BTRFS_I(inode)->i_otime.tv_sec = in btrfs_read_locked_inode()
3342 BTRFS_I(inode)->i_otime.tv_nsec = in btrfs_read_locked_inode()
3346 BTRFS_I(inode)->generation = btrfs_inode_generation(leaf, inode_item); in btrfs_read_locked_inode()
3347 BTRFS_I(inode)->last_trans = btrfs_inode_transid(leaf, inode_item); in btrfs_read_locked_inode()
3351 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_read_locked_inode()
3355 BTRFS_I(inode)->index_cnt = (u64)-1; in btrfs_read_locked_inode()
3356 BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item); in btrfs_read_locked_inode()
3368 if (BTRFS_I(inode)->last_trans == fs_info->generation) in btrfs_read_locked_inode()
3370 &BTRFS_I(inode)->runtime_flags); in btrfs_read_locked_inode()
3399 BTRFS_I(inode)->last_unlink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3407 BTRFS_I(inode)->last_reflink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3415 if (location.objectid != btrfs_ino(BTRFS_I(inode))) in btrfs_read_locked_inode()
3423 BTRFS_I(inode)->dir_index = btrfs_inode_ref_index(leaf, ref); in btrfs_read_locked_inode()
3428 BTRFS_I(inode)->dir_index = btrfs_inode_extref_index(leaf, in btrfs_read_locked_inode()
3437 btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); in btrfs_read_locked_inode()
3444 btrfs_ino(BTRFS_I(inode)), in btrfs_read_locked_inode()
3492 btrfs_set_token_inode_size(&token, item, BTRFS_I(inode)->disk_i_size); in fill_inode_item()
3512 BTRFS_I(inode)->i_otime.tv_sec); in fill_inode_item()
3514 BTRFS_I(inode)->i_otime.tv_nsec); in fill_inode_item()
3518 BTRFS_I(inode)->generation); in fill_inode_item()
3522 btrfs_set_token_inode_flags(&token, item, BTRFS_I(inode)->flags); in fill_inode_item()
3542 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location, in btrfs_update_inode_item()
3556 btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); in btrfs_update_inode_item()
3579 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) in btrfs_update_inode()
3586 btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); in btrfs_update_inode()
3739 struct btrfs_root *root = BTRFS_I(dir)->root; in __unlink_start_trans()
3753 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink()
3762 btrfs_record_unlink_dir(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)), in btrfs_unlink()
3765 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_unlink()
3766 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_unlink()
3772 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_unlink()
3786 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink_subvol()
3787 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry)); in btrfs_unlink_subvol()
3797 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); in btrfs_unlink_subvol()
3864 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); in btrfs_unlink_subvol()
3870 btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); in btrfs_unlink_subvol()
4003 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_delete_subvolume()
4005 struct btrfs_root *dest = BTRFS_I(inode)->root; in btrfs_delete_subvolume()
4061 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); in btrfs_delete_subvolume()
4146 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_rmdir()
4152 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) in btrfs_rmdir()
4159 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { in btrfs_rmdir()
4164 err = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_rmdir()
4168 last_unlink_trans = BTRFS_I(inode)->last_unlink_trans; in btrfs_rmdir()
4171 err = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_rmdir()
4172 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_rmdir()
4175 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_rmdir()
4188 BTRFS_I(dir)->last_unlink_trans = last_unlink_trans; in btrfs_rmdir()
4237 u64 ino = btrfs_ino(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4251 if (!btrfs_is_free_space_inode(BTRFS_I(inode)) && in btrfs_truncate_inode_items()
4261 lock_extent_bits(&BTRFS_I(inode)->io_tree, lock_start, (u64)-1, in btrfs_truncate_inode_items()
4269 btrfs_drop_extent_cache(BTRFS_I(inode), ALIGN(new_size, in btrfs_truncate_inode_items()
4280 if (min_type == 0 && root == BTRFS_I(inode)->root) in btrfs_truncate_inode_items()
4281 btrfs_kill_delayed_inode_items(BTRFS_I(inode)); in btrfs_truncate_inode_items()
4337 BTRFS_I(inode), leaf, fi, in btrfs_truncate_inode_items()
4344 BTRFS_I(inode), leaf, fi, path->slots[0], in btrfs_truncate_inode_items()
4441 if (root == BTRFS_I(inode)->root) { in btrfs_truncate_inode_items()
4442 ret = btrfs_inode_clear_file_extent_range(BTRFS_I(inode), in btrfs_truncate_inode_items()
4551 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, in btrfs_truncate_inode_items()
4575 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_truncate_block()
4598 ret = btrfs_check_data_free_space(BTRFS_I(inode), &data_reserved, in btrfs_truncate_block()
4601 if (btrfs_check_nocow_lock(BTRFS_I(inode), block_start, in btrfs_truncate_block()
4609 ret = btrfs_delalloc_reserve_metadata(BTRFS_I(inode), blocksize); in btrfs_truncate_block()
4612 btrfs_free_reserved_data_space(BTRFS_I(inode), in btrfs_truncate_block()
4619 btrfs_delalloc_release_space(BTRFS_I(inode), data_reserved, in btrfs_truncate_block()
4621 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize); in btrfs_truncate_block()
4644 ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), block_start); in btrfs_truncate_block()
4655 clear_extent_bit(&BTRFS_I(inode)->io_tree, block_start, block_end, in btrfs_truncate_block()
4659 ret = btrfs_set_extent_delalloc(BTRFS_I(inode), block_start, block_end, 0, in btrfs_truncate_block()
4685 set_extent_bit(&BTRFS_I(inode)->io_tree, block_start, in btrfs_truncate_block()
4692 btrfs_delalloc_release_metadata(BTRFS_I(inode), in btrfs_truncate_block()
4695 btrfs_delalloc_release_space(BTRFS_I(inode), data_reserved, in btrfs_truncate_block()
4698 btrfs_delalloc_release_extents(BTRFS_I(inode), blocksize); in btrfs_truncate_block()
4703 btrfs_check_nocow_unlock(BTRFS_I(inode)); in btrfs_truncate_block()
4720 BTRFS_I(inode)->last_trans = fs_info->generation; in maybe_insert_hole()
4721 BTRFS_I(inode)->last_sub_trans = root->log_transid; in maybe_insert_hole()
4722 BTRFS_I(inode)->last_log_commit = root->last_log_commit; in maybe_insert_hole()
4742 ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), in maybe_insert_hole()
4761 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_cont_expand()
4762 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_cont_expand()
4765 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in btrfs_cont_expand()
4785 btrfs_lock_and_flush_ordered_range(BTRFS_I(inode), hole_start, in btrfs_cont_expand()
4789 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset, in btrfs_cont_expand()
4808 err = btrfs_inode_set_file_extent_range(BTRFS_I(inode), in btrfs_cont_expand()
4813 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in btrfs_cont_expand()
4818 &BTRFS_I(inode)->runtime_flags); in btrfs_cont_expand()
4838 btrfs_drop_extent_cache(BTRFS_I(inode), in btrfs_cont_expand()
4845 err = btrfs_inode_set_file_extent_range(BTRFS_I(inode), in btrfs_cont_expand()
4864 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setsize()
4920 &BTRFS_I(inode)->runtime_flags); in btrfs_setsize()
4939 i_size_write(inode, BTRFS_I(inode)->disk_i_size); in btrfs_setsize()
4949 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setattr()
4991 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in evict_inode_truncate_pages()
4992 struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; in evict_inode_truncate_pages()
5058 btrfs_qgroup_free_data(BTRFS_I(inode), NULL, start, in evict_inode_truncate_pages()
5127 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_evict_inode()
5143 btrfs_is_free_space_inode(BTRFS_I(inode)))) in btrfs_evict_inode()
5149 btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1); in btrfs_evict_inode()
5160 ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode)); in btrfs_evict_inode()
5170 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_evict_inode()
5201 btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_evict_inode()
5208 btrfs_return_ino(root, btrfs_ino(BTRFS_I(inode))); in btrfs_evict_inode()
5218 btrfs_remove_delayed_node(BTRFS_I(inode)); in btrfs_evict_inode()
5236 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_inode_by_name()
5243 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5256 __func__, name, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5292 key.objectid = BTRFS_I(dir)->root->root_key.objectid; in fixup_tree_root_location()
5305 if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || in fixup_tree_root_location()
5335 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_add()
5339 struct rb_node *new = &BTRFS_I(inode)->rb_node; in inode_tree_add()
5340 u64 ino = btrfs_ino(BTRFS_I(inode)); in inode_tree_add()
5397 BTRFS_I(inode)->location.objectid = args->ino; in btrfs_init_locked_inode()
5398 BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY; in btrfs_init_locked_inode()
5399 BTRFS_I(inode)->location.offset = 0; in btrfs_init_locked_inode()
5400 BTRFS_I(inode)->root = btrfs_grab_root(args->root); in btrfs_init_locked_inode()
5401 BUG_ON(args->root && !BTRFS_I(inode)->root); in btrfs_init_locked_inode()
5409 return args->ino == BTRFS_I(inode)->location.objectid && in btrfs_find_actor()
5410 args->root == BTRFS_I(inode)->root; in btrfs_find_actor()
5481 BTRFS_I(inode)->root = btrfs_grab_root(root); in new_simple_dir()
5482 memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); in new_simple_dir()
5483 set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags); in new_simple_dir()
5497 BTRFS_I(inode)->i_otime = inode->i_mtime; in new_simple_dir()
5524 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_lookup_dentry()
5590 root = BTRFS_I(inode)->root; in btrfs_dentry_delete()
5594 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_dentry_delete()
5663 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_real_readdir()
5699 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_real_readdir()
5808 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_dirty_inode()
5812 if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) in btrfs_dirty_inode()
5830 if (BTRFS_I(inode)->delayed_node) in btrfs_dirty_inode()
5843 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_update_time()
5944 args.ino = BTRFS_I(inode)->location.objectid; in btrfs_insert_inode_locked()
5945 args.root = BTRFS_I(inode)->root; in btrfs_insert_inode_locked()
5948 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root), in btrfs_insert_inode_locked()
5964 flags = BTRFS_I(dir)->flags; in btrfs_inherit_iflags()
5967 BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
5968 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
5970 BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
5971 BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
5975 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; in btrfs_inherit_iflags()
5977 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_inherit_iflags()
6031 ret = btrfs_set_inode_index(BTRFS_I(dir), index); in btrfs_new_inode()
6045 BTRFS_I(inode)->index_cnt = 2; in btrfs_new_inode()
6046 BTRFS_I(inode)->dir_index = *index; in btrfs_new_inode()
6047 BTRFS_I(inode)->root = btrfs_grab_root(root); in btrfs_new_inode()
6048 BTRFS_I(inode)->generation = trans->transid; in btrfs_new_inode()
6049 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_new_inode()
6057 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_new_inode()
6079 location = &BTRFS_I(inode)->location; in btrfs_new_inode()
6101 BTRFS_I(inode)->i_otime = inode->i_mtime; in btrfs_new_inode()
6125 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_new_inode()
6127 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | in btrfs_new_inode()
6134 btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); in btrfs_new_inode()
6142 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); in btrfs_new_inode()
6150 BTRFS_I(dir)->index_cnt--; in btrfs_new_inode()
6261 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mknod()
6281 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mknod()
6302 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_mknod()
6325 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_create()
6345 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_create()
6370 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_create()
6391 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_link()
6399 if (root->root_key.objectid != BTRFS_I(inode)->root->root_key.objectid) in btrfs_link()
6405 err = btrfs_set_inode_index(BTRFS_I(dir), &index); in btrfs_link()
6423 BTRFS_I(inode)->dir_index = 0ULL; in btrfs_link()
6428 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); in btrfs_link()
6430 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_link()
6446 err = btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_link()
6451 btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent); in btrfs_link()
6470 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mkdir()
6489 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mkdir()
6505 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_mkdir()
6510 err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), in btrfs_mkdir()
7026 struct btrfs_root *root = BTRFS_I(inode)->root; in can_nocow_extent()
7027 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in can_nocow_extent()
7036 bool nocow = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW); in can_nocow_extent()
7043 btrfs_ino(BTRFS_I(inode)), offset, 0); in can_nocow_extent()
7059 if (key.objectid != btrfs_ino(BTRFS_I(inode)) || in can_nocow_extent()
7135 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), in can_nocow_extent()
7171 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7178 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7193 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7322 ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in btrfs_get_blocks_direct_write()
7339 em2 = btrfs_create_dio_extent(BTRFS_I(inode), start, len, in btrfs_get_blocks_direct_write()
7365 *map = em = btrfs_new_extent_direct(BTRFS_I(inode), start, len); in btrfs_get_blocks_direct_write()
7424 &BTRFS_I(inode)->runtime_flags)) { in btrfs_dio_iomap_begin()
7439 ret = btrfs_delalloc_reserve_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7460 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_dio_iomap_begin()
7519 unlock_extent_cached(&BTRFS_I(inode)->io_tree, in btrfs_dio_iomap_begin()
7546 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_dio_iomap_begin()
7550 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7553 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->reserve); in btrfs_dio_iomap_begin()
7570 unlock_extent(&BTRFS_I(inode)->io_tree, pos, pos + length - 1); in btrfs_dio_iomap_end()
7578 __endio_write_update_ordered(BTRFS_I(inode), pos, in btrfs_dio_iomap_end()
7581 unlock_extent(&BTRFS_I(inode)->io_tree, pos, in btrfs_dio_iomap_end()
7588 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_end()
7591 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->length); in btrfs_dio_iomap_end()
7619 __endio_write_update_ordered(BTRFS_I(dip->inode), in btrfs_dio_private_put()
7624 unlock_extent(&BTRFS_I(dip->inode)->io_tree, in btrfs_dio_private_put()
7658 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_check_read_dio_bio()
7660 struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_check_read_dio_bio()
7661 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_check_read_dio_bio()
7662 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_check_read_dio_bio()
7682 btrfs_ino(BTRFS_I(inode)), in btrfs_check_read_dio_bio()
7754 return btrfs_csum_one_bio(BTRFS_I(inode), bio, offset, 1); in btrfs_submit_bio_start_direct_io()
7763 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
7765 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
7792 async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_dio_bio()
7800 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_submit_dio_bio()
7813 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, file_offset, 1); in btrfs_submit_dio_bio()
7839 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_create_dio_private()
7870 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_submit_direct()
7889 unlock_extent(&BTRFS_I(inode)->io_tree, file_offset, in btrfs_submit_direct()
8078 down_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8096 up_read(&BTRFS_I(inode)->dio_sem); in btrfs_direct_IO()
8114 return extent_fiemap(BTRFS_I(inode), fieinfo, start, len); in btrfs_fiemap()
8119 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_readpage()
8215 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_invalidatepage()
8350 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_page_mkwrite()
8380 ret2 = btrfs_delalloc_reserve_space(BTRFS_I(inode), &data_reserved, in btrfs_page_mkwrite()
8412 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8428 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_page_mkwrite()
8441 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end, in btrfs_page_mkwrite()
8445 ret2 = btrfs_set_extent_delalloc(BTRFS_I(inode), page_start, end, 0, in btrfs_page_mkwrite()
8470 btrfs_set_inode_last_sub_trans(BTRFS_I(inode)); in btrfs_page_mkwrite()
8474 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8482 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8483 btrfs_delalloc_release_space(BTRFS_I(inode), data_reserved, page_start, in btrfs_page_mkwrite()
8494 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_truncate()
8564 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_truncate()
8658 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_create_subvol_root()
8737 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_test_destroy_inode()
8738 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_test_destroy_inode()
8744 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_free_inode()
8750 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_destroy_inode()
8793 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_drop_inode()
8871 u32 bi_flags = BTRFS_I(inode)->flags; in btrfs_getattr()
8874 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec; in btrfs_getattr()
8875 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec; in btrfs_getattr()
8891 stat->dev = BTRFS_I(inode)->root->anon_dev; in btrfs_getattr()
8893 spin_lock(&BTRFS_I(inode)->lock); in btrfs_getattr()
8894 delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes; in btrfs_getattr()
8895 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_getattr()
8908 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename_exchange()
8909 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename_exchange()
8913 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename_exchange()
8914 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); in btrfs_rename_exchange()
8959 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &old_idx); in btrfs_rename_exchange()
8962 ret = btrfs_set_inode_index(BTRFS_I(old_dir), &new_idx); in btrfs_rename_exchange()
8966 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
8967 BTRFS_I(new_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
8980 btrfs_ino(BTRFS_I(new_dir)), in btrfs_rename_exchange()
8998 btrfs_ino(BTRFS_I(old_dir)), in btrfs_rename_exchange()
9018 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9019 BTRFS_I(old_inode), 1); in btrfs_rename_exchange()
9020 btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9021 BTRFS_I(new_inode), 1); in btrfs_rename_exchange()
9028 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename_exchange()
9029 BTRFS_I(old_dentry->d_inode), in btrfs_rename_exchange()
9044 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename_exchange()
9045 BTRFS_I(new_dentry->d_inode), in btrfs_rename_exchange()
9056 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename_exchange()
9064 ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode), in btrfs_rename_exchange()
9073 BTRFS_I(old_inode)->dir_index = old_idx; in btrfs_rename_exchange()
9075 BTRFS_I(new_inode)->dir_index = new_idx; in btrfs_rename_exchange()
9078 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename_exchange()
9084 btrfs_log_new_name(trans, BTRFS_I(new_inode), BTRFS_I(new_dir), in btrfs_rename_exchange()
9102 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename_exchange()
9103 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename_exchange()
9104 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename_exchange()
9106 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename_exchange()
9145 btrfs_ino(BTRFS_I(dir)), in btrfs_whiteout_for_rename()
9164 ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_whiteout_for_rename()
9165 BTRFS_I(inode), 0, index); in btrfs_whiteout_for_rename()
9186 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename()
9187 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename()
9193 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename()
9196 if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_rename()
9204 (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) in btrfs_rename()
9264 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index); in btrfs_rename()
9268 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename()
9279 btrfs_ino(BTRFS_I(new_dir)), index); in btrfs_rename()
9292 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename()
9293 BTRFS_I(old_inode), 1); in btrfs_rename()
9298 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename()
9299 BTRFS_I(d_inode(old_dentry)), in btrfs_rename()
9313 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == in btrfs_rename()
9318 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename()
9319 BTRFS_I(d_inode(new_dentry)), in btrfs_rename()
9325 BTRFS_I(d_inode(new_dentry))); in btrfs_rename()
9332 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename()
9341 BTRFS_I(old_inode)->dir_index = index; in btrfs_rename()
9344 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename()
9372 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename()
9373 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename()
9374 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename()
9376 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename()
9422 &BTRFS_I(inode)->runtime_flags)) in btrfs_run_delalloc_work()
9502 &BTRFS_I(inode)->runtime_flags)) in start_delalloc_inodes()
9606 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_symlink()
9639 dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), in btrfs_symlink()
9666 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_symlink()
9695 btrfs_i_size_write(BTRFS_I(inode), name_len); in btrfs_symlink()
9703 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_symlink()
9704 BTRFS_I(inode), 0, index); in btrfs_symlink()
9743 ret = btrfs_qgroup_release_data(BTRFS_I(inode), file_offset, len); in insert_prealloc_file_extent()
9748 ret = insert_reserved_file_extent(trans, BTRFS_I(inode), in insert_prealloc_file_extent()
9785 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in __btrfs_prealloc_file_range()
9787 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_prealloc_file_range()
9840 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
9846 &BTRFS_I(inode)->runtime_flags); in __btrfs_prealloc_file_range()
9866 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
9878 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; in __btrfs_prealloc_file_range()
9905 btrfs_free_reserved_data_space(BTRFS_I(inode), NULL, clear_offset, in __btrfs_prealloc_file_range()
9935 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_permission()
9942 if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) in btrfs_permission()
9952 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_tmpfile()
9970 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_tmpfile()
9989 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_tmpfile()
10037 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_add_swapfile_pin()
10078 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_free_swapfile_pins()
10158 atomic_dec(&BTRFS_I(inode)->root->nr_swapfiles); in btrfs_swap_deactivate()
10165 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_swap_activate()
10167 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_swap_activate()
10190 if (BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS) { in btrfs_swap_activate()
10194 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW)) { in btrfs_swap_activate()
10198 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) { in btrfs_swap_activate()
10263 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_swap_activate()