Lines Matching refs:BTRFS_I

130 		down_write(&BTRFS_I(inode)->i_mmap_lock);  in btrfs_inode_lock()
143 up_write(&BTRFS_I(inode)->i_mmap_lock); in btrfs_inode_unlock()
263 key.objectid = btrfs_ino(BTRFS_I(inode)); in insert_inline_extent()
319 ret = btrfs_inode_set_file_extent_range(BTRFS_I(inode), start, size); in insert_inline_extent()
332 BTRFS_I(inode)->disk_i_size = inode->i_size; in insert_inline_extent()
609 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
652 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
676 if (inode_need_compress(BTRFS_I(inode), start, end)) { in compress_file_range()
685 if (BTRFS_I(inode)->defrag_compress) in compress_file_range()
686 compress_type = BTRFS_I(inode)->defrag_compress; in compress_file_range()
687 else if (BTRFS_I(inode)->prop_compress) in compress_file_range()
688 compress_type = BTRFS_I(inode)->prop_compress; in compress_file_range()
739 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
744 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
766 extent_clear_unlock_delalloc(BTRFS_I(inode), start, end, in compress_file_range()
841 !(BTRFS_I(inode)->prop_compress)) { in compress_file_range()
842 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in compress_file_range()
1043 struct btrfs_inode *inode = BTRFS_I(async_chunk->inode); in submit_compressed_extents()
2065 spin_lock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
2066 btrfs_mod_outstanding_extents(BTRFS_I(inode), 1); in btrfs_split_delalloc_extent()
2067 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
2092 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2093 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
2094 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2123 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2124 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
2125 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2134 if (list_empty(&BTRFS_I(inode)->delalloc_inodes)) { in btrfs_add_delalloc_inodes()
2135 list_add_tail(&BTRFS_I(inode)->delalloc_inodes, in btrfs_add_delalloc_inodes()
2138 &BTRFS_I(inode)->runtime_flags); in btrfs_add_delalloc_inodes()
2197 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_set_delalloc_extent()
2200 bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_set_delalloc_extent()
2202 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2203 btrfs_mod_outstanding_extents(BTRFS_I(inode), num_extents); in btrfs_set_delalloc_extent()
2204 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2212 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2213 BTRFS_I(inode)->delalloc_bytes += len; in btrfs_set_delalloc_extent()
2215 BTRFS_I(inode)->defrag_bytes += len; in btrfs_set_delalloc_extent()
2217 &BTRFS_I(inode)->runtime_flags)) in btrfs_set_delalloc_extent()
2219 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2224 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2225 BTRFS_I(inode)->new_delalloc_bytes += state->end + 1 - in btrfs_set_delalloc_extent()
2227 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2238 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_clear_delalloc_extent()
2313 return btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_bio_start()
2514 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_submit_data_bio()
2518 int async = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_data_bio()
2520 skip_sum = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) || in btrfs_submit_data_bio()
2523 if (btrfs_is_free_space_inode(BTRFS_I(inode))) in btrfs_submit_data_bio()
2530 ret = extract_ordered_extent(BTRFS_I(inode), bio, file_offset); in btrfs_submit_data_bio()
2565 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_data_bio()
2690 inode = BTRFS_I(fixup->inode); in btrfs_writepage_fixup_worker()
2995 return insert_reserved_file_extent(trans, BTRFS_I(oe->inode), in insert_ordered_extent_file_extent()
3007 struct btrfs_inode *inode = BTRFS_I(ordered_extent->inode); in btrfs_finish_ordered_io()
3268 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in check_data_csum()
3297 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_verify_data_csum()
3298 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_verify_data_csum()
3316 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_verify_data_csum()
3365 struct btrfs_inode *binode = BTRFS_I(inode); in btrfs_add_delayed_iput()
3610 ret = btrfs_drop_verity_items(BTRFS_I(inode)); in btrfs_orphan_cleanup()
3735 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_read_locked_inode()
3754 memcpy(&location, &BTRFS_I(inode)->location, sizeof(location)); in btrfs_read_locked_inode()
3774 btrfs_i_size_write(BTRFS_I(inode), btrfs_inode_size(leaf, inode_item)); in btrfs_read_locked_inode()
3775 btrfs_inode_set_file_extent_range(BTRFS_I(inode), 0, in btrfs_read_locked_inode()
3787 BTRFS_I(inode)->i_otime.tv_sec = in btrfs_read_locked_inode()
3789 BTRFS_I(inode)->i_otime.tv_nsec = in btrfs_read_locked_inode()
3793 BTRFS_I(inode)->generation = btrfs_inode_generation(leaf, inode_item); in btrfs_read_locked_inode()
3794 BTRFS_I(inode)->last_trans = btrfs_inode_transid(leaf, inode_item); in btrfs_read_locked_inode()
3798 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_read_locked_inode()
3802 BTRFS_I(inode)->index_cnt = (u64)-1; in btrfs_read_locked_inode()
3804 &BTRFS_I(inode)->flags, &BTRFS_I(inode)->ro_flags); in btrfs_read_locked_inode()
3816 if (BTRFS_I(inode)->last_trans == fs_info->generation) in btrfs_read_locked_inode()
3818 &BTRFS_I(inode)->runtime_flags); in btrfs_read_locked_inode()
3847 BTRFS_I(inode)->last_unlink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3855 BTRFS_I(inode)->last_reflink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3863 if (location.objectid != btrfs_ino(BTRFS_I(inode))) in btrfs_read_locked_inode()
3871 BTRFS_I(inode)->dir_index = btrfs_inode_ref_index(leaf, ref); in btrfs_read_locked_inode()
3876 BTRFS_I(inode)->dir_index = btrfs_inode_extref_index(leaf, in btrfs_read_locked_inode()
3885 btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); in btrfs_read_locked_inode()
3892 btrfs_ino(BTRFS_I(inode)), in btrfs_read_locked_inode()
3941 btrfs_set_token_inode_size(&token, item, BTRFS_I(inode)->disk_i_size); in fill_inode_item()
3961 BTRFS_I(inode)->i_otime.tv_sec); in fill_inode_item()
3963 BTRFS_I(inode)->i_otime.tv_nsec); in fill_inode_item()
3967 BTRFS_I(inode)->generation); in fill_inode_item()
3971 flags = btrfs_inode_combine_flags(BTRFS_I(inode)->flags, in fill_inode_item()
3972 BTRFS_I(inode)->ro_flags); in fill_inode_item()
4177 struct btrfs_root *root = BTRFS_I(dir)->root; in __unlink_start_trans()
4199 btrfs_record_unlink_dir(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)), in btrfs_unlink()
4202 ret = btrfs_unlink_inode(trans, BTRFS_I(dir), in btrfs_unlink()
4203 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_unlink()
4209 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_unlink()
4216 btrfs_btree_balance_dirty(BTRFS_I(dir)->root->fs_info); in btrfs_unlink()
4223 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink_subvol()
4224 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry)); in btrfs_unlink_subvol()
4234 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); in btrfs_unlink_subvol()
4301 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); in btrfs_unlink_subvol()
4307 btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); in btrfs_unlink_subvol()
4310 ret = btrfs_update_inode_fallback(trans, root, BTRFS_I(dir)); in btrfs_unlink_subvol()
4440 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_delete_subvolume()
4442 struct btrfs_root *dest = BTRFS_I(inode)->root; in btrfs_delete_subvolume()
4490 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); in btrfs_delete_subvolume()
4572 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) in btrfs_rmdir()
4579 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { in btrfs_rmdir()
4584 err = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_rmdir()
4588 last_unlink_trans = BTRFS_I(inode)->last_unlink_trans; in btrfs_rmdir()
4591 err = btrfs_unlink_inode(trans, BTRFS_I(dir), in btrfs_rmdir()
4592 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_rmdir()
4595 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_rmdir()
4608 BTRFS_I(dir)->last_unlink_trans = last_unlink_trans; in btrfs_rmdir()
4612 btrfs_btree_balance_dirty(BTRFS_I(dir)->root->fs_info); in btrfs_rmdir()
5306 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setsize()
5335 ret = btrfs_cont_expand(BTRFS_I(inode), oldsize, newsize); in btrfs_setsize()
5348 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in btrfs_setsize()
5350 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_setsize()
5371 &BTRFS_I(inode)->runtime_flags); in btrfs_setsize()
5390 i_size_write(inode, BTRFS_I(inode)->disk_i_size); in btrfs_setsize()
5401 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setattr()
5443 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in evict_inode_truncate_pages()
5444 struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; in evict_inode_truncate_pages()
5510 btrfs_qgroup_free_data(BTRFS_I(inode), NULL, start, in evict_inode_truncate_pages()
5579 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_evict_inode()
5596 btrfs_is_free_space_inode(BTRFS_I(inode)))) in btrfs_evict_inode()
5602 btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1); in btrfs_evict_inode()
5613 ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode)); in btrfs_evict_inode()
5623 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_evict_inode()
5632 ret = btrfs_truncate_inode_items(trans, root, BTRFS_I(inode), in btrfs_evict_inode()
5655 btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_evict_inode()
5668 btrfs_remove_delayed_node(BTRFS_I(inode)); in btrfs_evict_inode()
5687 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_inode_by_name()
5694 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5707 __func__, name, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5743 key.objectid = BTRFS_I(dir)->root->root_key.objectid; in fixup_tree_root_location()
5756 if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || in fixup_tree_root_location()
5786 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_add()
5790 struct rb_node *new = &BTRFS_I(inode)->rb_node; in inode_tree_add()
5791 u64 ino = btrfs_ino(BTRFS_I(inode)); in inode_tree_add()
5848 BTRFS_I(inode)->location.objectid = args->ino; in btrfs_init_locked_inode()
5849 BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY; in btrfs_init_locked_inode()
5850 BTRFS_I(inode)->location.offset = 0; in btrfs_init_locked_inode()
5851 BTRFS_I(inode)->root = btrfs_grab_root(args->root); in btrfs_init_locked_inode()
5852 BUG_ON(args->root && !BTRFS_I(inode)->root); in btrfs_init_locked_inode()
5860 return args->ino == BTRFS_I(inode)->location.objectid && in btrfs_find_actor()
5861 args->root == BTRFS_I(inode)->root; in btrfs_find_actor()
5932 BTRFS_I(inode)->root = btrfs_grab_root(root); in new_simple_dir()
5933 memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); in new_simple_dir()
5934 set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags); in new_simple_dir()
5948 BTRFS_I(inode)->i_otime = inode->i_mtime; in new_simple_dir()
5975 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_lookup_dentry()
6041 root = BTRFS_I(inode)->root; in btrfs_dentry_delete()
6045 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_dentry_delete()
6114 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_real_readdir()
6150 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_real_readdir()
6259 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_dirty_inode()
6263 if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) in btrfs_dirty_inode()
6270 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_dirty_inode()
6278 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_dirty_inode()
6281 if (BTRFS_I(inode)->delayed_node) in btrfs_dirty_inode()
6294 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_update_time()
6395 args.ino = BTRFS_I(inode)->location.objectid; in btrfs_insert_inode_locked()
6396 args.root = BTRFS_I(inode)->root; in btrfs_insert_inode_locked()
6399 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root), in btrfs_insert_inode_locked()
6415 flags = BTRFS_I(dir)->flags; in btrfs_inherit_iflags()
6418 BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6419 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6421 BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6422 BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6426 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; in btrfs_inherit_iflags()
6428 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_inherit_iflags()
6483 ret = btrfs_set_inode_index(BTRFS_I(dir), index); in btrfs_new_inode()
6497 BTRFS_I(inode)->index_cnt = 2; in btrfs_new_inode()
6498 BTRFS_I(inode)->dir_index = *index; in btrfs_new_inode()
6499 BTRFS_I(inode)->root = btrfs_grab_root(root); in btrfs_new_inode()
6500 BTRFS_I(inode)->generation = trans->transid; in btrfs_new_inode()
6501 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_new_inode()
6509 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_new_inode()
6531 location = &BTRFS_I(inode)->location; in btrfs_new_inode()
6556 BTRFS_I(inode)->i_otime = inode->i_mtime; in btrfs_new_inode()
6580 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_new_inode()
6582 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | in btrfs_new_inode()
6589 btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); in btrfs_new_inode()
6597 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); in btrfs_new_inode()
6605 BTRFS_I(dir)->index_cnt--; in btrfs_new_inode()
6716 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mknod()
6737 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_mknod()
6757 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_mknod()
6762 btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_mknod()
6780 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_create()
6801 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_create()
6821 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_create()
6825 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_create()
6846 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_link()
6854 if (root->root_key.objectid != BTRFS_I(inode)->root->root_key.objectid) in btrfs_link()
6860 err = btrfs_set_inode_index(BTRFS_I(dir), &index); in btrfs_link()
6878 BTRFS_I(inode)->dir_index = 0ULL; in btrfs_link()
6883 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); in btrfs_link()
6885 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_link()
6893 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_link()
6901 err = btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_link()
6906 btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent); in btrfs_link()
6926 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mkdir()
6946 btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mkdir()
6962 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_mkdir()
6963 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_mkdir()
6967 err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), in btrfs_mkdir()
7492 struct btrfs_root *root = BTRFS_I(inode)->root; in can_nocow_extent()
7493 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in can_nocow_extent()
7502 bool nocow = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW); in can_nocow_extent()
7509 btrfs_ino(BTRFS_I(inode)), offset, 0); in can_nocow_extent()
7525 if (key.objectid != btrfs_ino(BTRFS_I(inode)) || in can_nocow_extent()
7601 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), in can_nocow_extent()
7637 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7644 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7659 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7788 ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in btrfs_get_blocks_direct_write()
7805 em2 = btrfs_create_dio_extent(BTRFS_I(inode), start, len, in btrfs_get_blocks_direct_write()
7831 *map = em = btrfs_new_extent_direct(BTRFS_I(inode), start, len); in btrfs_get_blocks_direct_write()
7879 &BTRFS_I(inode)->runtime_flags)) { in btrfs_dio_iomap_begin()
7893 ret = btrfs_delalloc_reserve_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7914 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_dio_iomap_begin()
7961 unlock_extent_cached(&BTRFS_I(inode)->io_tree, in btrfs_dio_iomap_begin()
7983 if (write && btrfs_use_zone_append(BTRFS_I(inode), em->block_start)) in btrfs_dio_iomap_begin()
7991 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_dio_iomap_begin()
7995 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7998 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->reserve); in btrfs_dio_iomap_begin()
8015 unlock_extent(&BTRFS_I(inode)->io_tree, pos, pos + length - 1); in btrfs_dio_iomap_end()
8023 __endio_write_update_ordered(BTRFS_I(inode), pos, in btrfs_dio_iomap_end()
8026 unlock_extent(&BTRFS_I(inode)->io_tree, pos, in btrfs_dio_iomap_end()
8033 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_end()
8036 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->length); in btrfs_dio_iomap_end()
8056 __endio_write_update_ordered(BTRFS_I(dip->inode), in btrfs_dio_private_put()
8061 unlock_extent(&BTRFS_I(dip->inode)->io_tree, in btrfs_dio_private_put()
8096 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_check_read_dio_bio()
8098 struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_check_read_dio_bio()
8099 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_check_read_dio_bio()
8100 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_check_read_dio_bio()
8121 btrfs_ino(BTRFS_I(inode)), in btrfs_check_read_dio_bio()
8157 return btrfs_csum_one_bio(BTRFS_I(inode), bio, dio_file_offset, 1); in btrfs_submit_bio_start_direct_io()
8166 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
8168 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
8194 async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_dio_bio()
8202 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_submit_dio_bio()
8214 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, file_offset, 1); in btrfs_submit_dio_bio()
8240 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_create_dio_private()
8291 unlock_extent(&BTRFS_I(inode)->io_tree, file_offset, in btrfs_submit_direct()
8341 status = extract_ordered_extent(BTRFS_I(inode), bio, in btrfs_submit_direct()
8416 return extent_fiemap(BTRFS_I(inode), fieinfo, start, len); in btrfs_fiemap()
8421 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_readpage()
8552 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_invalidatepage()
8738 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_page_mkwrite()
8767 ret2 = btrfs_delalloc_reserve_space(BTRFS_I(inode), &data_reserved, in btrfs_page_mkwrite()
8782 down_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8805 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8811 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8822 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_page_mkwrite()
8835 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end, in btrfs_page_mkwrite()
8839 ret2 = btrfs_set_extent_delalloc(BTRFS_I(inode), page_start, end, 0, in btrfs_page_mkwrite()
8862 btrfs_set_inode_last_sub_trans(BTRFS_I(inode)); in btrfs_page_mkwrite()
8865 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8867 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8874 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8876 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8877 btrfs_delalloc_release_space(BTRFS_I(inode), data_reserved, page_start, in btrfs_page_mkwrite()
8888 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_truncate()
8955 ret = btrfs_truncate_inode_items(trans, root, BTRFS_I(inode), in btrfs_truncate()
8963 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_truncate()
8994 ret = btrfs_truncate_block(BTRFS_I(inode), inode->i_size, 0, 0); in btrfs_truncate()
9002 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in btrfs_truncate()
9009 ret2 = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_truncate()
9035 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_truncate()
9067 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_create_subvol_root()
9076 err = btrfs_update_inode(trans, new_root, BTRFS_I(inode)); in btrfs_create_subvol_root()
9147 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_test_destroy_inode()
9148 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_test_destroy_inode()
9154 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_free_inode()
9160 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_destroy_inode()
9205 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_drop_inode()
9285 u32 bi_flags = BTRFS_I(inode)->flags; in btrfs_getattr()
9286 u32 bi_ro_flags = BTRFS_I(inode)->ro_flags; in btrfs_getattr()
9289 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec; in btrfs_getattr()
9290 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec; in btrfs_getattr()
9308 stat->dev = BTRFS_I(inode)->root->anon_dev; in btrfs_getattr()
9310 spin_lock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9311 delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes; in btrfs_getattr()
9313 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9326 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename_exchange()
9327 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename_exchange()
9331 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename_exchange()
9332 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); in btrfs_rename_exchange()
9380 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &old_idx); in btrfs_rename_exchange()
9383 ret = btrfs_set_inode_index(BTRFS_I(old_dir), &new_idx); in btrfs_rename_exchange()
9387 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9388 BTRFS_I(new_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9399 btrfs_ino(BTRFS_I(new_dir)), in btrfs_rename_exchange()
9415 btrfs_ino(BTRFS_I(old_dir)), in btrfs_rename_exchange()
9435 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9436 BTRFS_I(old_inode), 1); in btrfs_rename_exchange()
9437 btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9438 BTRFS_I(new_inode), 1); in btrfs_rename_exchange()
9468 ret = __btrfs_unlink_inode(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9469 BTRFS_I(old_dentry->d_inode), in btrfs_rename_exchange()
9473 ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode)); in btrfs_rename_exchange()
9484 ret = __btrfs_unlink_inode(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9485 BTRFS_I(new_dentry->d_inode), in btrfs_rename_exchange()
9489 ret = btrfs_update_inode(trans, dest, BTRFS_I(new_inode)); in btrfs_rename_exchange()
9496 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename_exchange()
9504 ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode), in btrfs_rename_exchange()
9513 BTRFS_I(old_inode)->dir_index = old_idx; in btrfs_rename_exchange()
9515 BTRFS_I(new_inode)->dir_index = new_idx; in btrfs_rename_exchange()
9518 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename_exchange()
9524 btrfs_log_new_name(trans, BTRFS_I(new_inode), BTRFS_I(new_dir), in btrfs_rename_exchange()
9542 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename_exchange()
9543 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename_exchange()
9544 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename_exchange()
9545 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation)) in btrfs_rename_exchange()
9585 btrfs_ino(BTRFS_I(dir)), in btrfs_whiteout_for_rename()
9604 ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_whiteout_for_rename()
9605 BTRFS_I(inode), 0, index); in btrfs_whiteout_for_rename()
9609 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_whiteout_for_rename()
9627 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename()
9628 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename()
9634 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename()
9637 if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_rename()
9645 (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) in btrfs_rename()
9708 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index); in btrfs_rename()
9712 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename()
9721 btrfs_ino(BTRFS_I(new_dir)), index); in btrfs_rename()
9734 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename()
9735 BTRFS_I(old_inode), 1); in btrfs_rename()
9759 ret = __btrfs_unlink_inode(trans, BTRFS_I(old_dir), in btrfs_rename()
9760 BTRFS_I(d_inode(old_dentry)), in btrfs_rename()
9764 ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode)); in btrfs_rename()
9774 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == in btrfs_rename()
9779 ret = btrfs_unlink_inode(trans, BTRFS_I(new_dir), in btrfs_rename()
9780 BTRFS_I(d_inode(new_dentry)), in btrfs_rename()
9786 BTRFS_I(d_inode(new_dentry))); in btrfs_rename()
9793 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename()
9802 BTRFS_I(old_inode)->dir_index = index; in btrfs_rename()
9805 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename()
9833 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename()
9834 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename()
9835 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename()
9837 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename()
9884 &BTRFS_I(inode)->runtime_flags)) in btrfs_run_delalloc_work()
10064 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_symlink()
10098 btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_symlink()
10125 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_symlink()
10154 btrfs_i_size_write(BTRFS_I(inode), name_len); in btrfs_symlink()
10155 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_symlink()
10162 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_symlink()
10163 BTRFS_I(inode), 0, index); in btrfs_symlink()
10261 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in __btrfs_prealloc_file_range()
10263 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_prealloc_file_range()
10301 trans = insert_prealloc_file_extent(trans, BTRFS_I(inode), in __btrfs_prealloc_file_range()
10317 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10323 &BTRFS_I(inode)->runtime_flags); in __btrfs_prealloc_file_range()
10343 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10355 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; in __btrfs_prealloc_file_range()
10364 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in __btrfs_prealloc_file_range()
10367 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in __btrfs_prealloc_file_range()
10382 btrfs_free_reserved_data_space(BTRFS_I(inode), NULL, clear_offset, in __btrfs_prealloc_file_range()
10413 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_permission()
10420 if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) in btrfs_permission()
10431 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_tmpfile()
10449 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_tmpfile()
10465 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_tmpfile()
10468 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_tmpfile()
10520 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_add_swapfile_pin()
10561 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_free_swapfile_pins()
10630 atomic_dec(&BTRFS_I(inode)->root->nr_swapfiles); in btrfs_swap_deactivate()
10637 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_swap_activate()
10639 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_swap_activate()
10662 if (BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS) { in btrfs_swap_activate()
10666 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW)) { in btrfs_swap_activate()
10670 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) { in btrfs_swap_activate()
10720 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_swap_activate()