Lines Matching refs:BTRFS_I

129 		down_write(&BTRFS_I(inode)->i_mmap_lock);  in btrfs_inode_lock()
142 up_write(&BTRFS_I(inode)->i_mmap_lock); in btrfs_inode_unlock()
262 key.objectid = btrfs_ino(BTRFS_I(inode)); in insert_inline_extent()
318 ret = btrfs_inode_set_file_extent_range(BTRFS_I(inode), start, size); in insert_inline_extent()
331 BTRFS_I(inode)->disk_i_size = inode->i_size; in insert_inline_extent()
580 inode_should_defrag(BTRFS_I(inode), start, end, end - start + 1, in compress_file_range()
623 (start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size)) in compress_file_range()
636 if (inode_need_compress(BTRFS_I(inode), start, end)) { in compress_file_range()
645 if (BTRFS_I(inode)->defrag_compress) in compress_file_range()
646 compress_type = BTRFS_I(inode)->defrag_compress; in compress_file_range()
647 else if (BTRFS_I(inode)->prop_compress) in compress_file_range()
648 compress_type = BTRFS_I(inode)->prop_compress; in compress_file_range()
699 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
704 ret = cow_file_range_inline(BTRFS_I(inode), start, end, in compress_file_range()
726 extent_clear_unlock_delalloc(BTRFS_I(inode), start, end, in compress_file_range()
801 !(BTRFS_I(inode)->prop_compress)) { in compress_file_range()
802 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in compress_file_range()
852 struct btrfs_inode *inode = BTRFS_I(async_chunk->inode); in submit_compressed_extents()
2000 spin_lock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
2001 btrfs_mod_outstanding_extents(BTRFS_I(inode), 1); in btrfs_split_delalloc_extent()
2002 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_split_delalloc_extent()
2027 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2028 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
2029 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2058 spin_lock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2059 btrfs_mod_outstanding_extents(BTRFS_I(inode), -1); in btrfs_merge_delalloc_extent()
2060 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_merge_delalloc_extent()
2069 if (list_empty(&BTRFS_I(inode)->delalloc_inodes)) { in btrfs_add_delalloc_inodes()
2070 list_add_tail(&BTRFS_I(inode)->delalloc_inodes, in btrfs_add_delalloc_inodes()
2073 &BTRFS_I(inode)->runtime_flags); in btrfs_add_delalloc_inodes()
2132 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_set_delalloc_extent()
2135 bool do_list = !btrfs_is_free_space_inode(BTRFS_I(inode)); in btrfs_set_delalloc_extent()
2137 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2138 btrfs_mod_outstanding_extents(BTRFS_I(inode), num_extents); in btrfs_set_delalloc_extent()
2139 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2147 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2148 BTRFS_I(inode)->delalloc_bytes += len; in btrfs_set_delalloc_extent()
2150 BTRFS_I(inode)->defrag_bytes += len; in btrfs_set_delalloc_extent()
2152 &BTRFS_I(inode)->runtime_flags)) in btrfs_set_delalloc_extent()
2154 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2159 spin_lock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2160 BTRFS_I(inode)->new_delalloc_bytes += state->end + 1 - in btrfs_set_delalloc_extent()
2162 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_set_delalloc_extent()
2173 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_clear_delalloc_extent()
2290 return btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_bio_start()
2491 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_submit_data_bio()
2495 int async = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_data_bio()
2497 skip_sum = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) || in btrfs_submit_data_bio()
2500 if (btrfs_is_free_space_inode(BTRFS_I(inode))) in btrfs_submit_data_bio()
2507 ret = extract_ordered_extent(BTRFS_I(inode), bio, file_offset); in btrfs_submit_data_bio()
2542 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, 0, 0); in btrfs_submit_data_bio()
2667 inode = BTRFS_I(fixup->inode); in btrfs_writepage_fixup_worker()
2972 return insert_reserved_file_extent(trans, BTRFS_I(oe->inode), in insert_ordered_extent_file_extent()
2984 struct btrfs_inode *inode = BTRFS_I(ordered_extent->inode); in btrfs_finish_ordered_io()
3241 btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, in check_data_csum()
3268 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_verify_data_csum()
3269 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_verify_data_csum()
3293 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_verify_data_csum()
3342 struct btrfs_inode *binode = BTRFS_I(inode); in btrfs_add_delayed_iput()
3587 ret = btrfs_drop_verity_items(BTRFS_I(inode)); in btrfs_orphan_cleanup()
3712 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_read_locked_inode()
3731 memcpy(&location, &BTRFS_I(inode)->location, sizeof(location)); in btrfs_read_locked_inode()
3751 btrfs_i_size_write(BTRFS_I(inode), btrfs_inode_size(leaf, inode_item)); in btrfs_read_locked_inode()
3752 btrfs_inode_set_file_extent_range(BTRFS_I(inode), 0, in btrfs_read_locked_inode()
3764 BTRFS_I(inode)->i_otime.tv_sec = in btrfs_read_locked_inode()
3766 BTRFS_I(inode)->i_otime.tv_nsec = in btrfs_read_locked_inode()
3770 BTRFS_I(inode)->generation = btrfs_inode_generation(leaf, inode_item); in btrfs_read_locked_inode()
3771 BTRFS_I(inode)->last_trans = btrfs_inode_transid(leaf, inode_item); in btrfs_read_locked_inode()
3775 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_read_locked_inode()
3779 BTRFS_I(inode)->index_cnt = (u64)-1; in btrfs_read_locked_inode()
3781 &BTRFS_I(inode)->flags, &BTRFS_I(inode)->ro_flags); 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 BTRFS_I(inode)->last_reflink_trans = BTRFS_I(inode)->last_trans; in btrfs_read_locked_inode()
3840 if (location.objectid != btrfs_ino(BTRFS_I(inode))) in btrfs_read_locked_inode()
3848 BTRFS_I(inode)->dir_index = btrfs_inode_ref_index(leaf, ref); in btrfs_read_locked_inode()
3853 BTRFS_I(inode)->dir_index = btrfs_inode_extref_index(leaf, in btrfs_read_locked_inode()
3862 btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); in btrfs_read_locked_inode()
3869 btrfs_ino(BTRFS_I(inode)), in btrfs_read_locked_inode()
3918 btrfs_set_token_inode_size(&token, item, BTRFS_I(inode)->disk_i_size); in fill_inode_item()
3938 BTRFS_I(inode)->i_otime.tv_sec); in fill_inode_item()
3940 BTRFS_I(inode)->i_otime.tv_nsec); in fill_inode_item()
3944 BTRFS_I(inode)->generation); in fill_inode_item()
3948 flags = btrfs_inode_combine_flags(BTRFS_I(inode)->flags, in fill_inode_item()
3949 BTRFS_I(inode)->ro_flags); in fill_inode_item()
4165 struct btrfs_root *root = BTRFS_I(dir)->root; in __unlink_start_trans()
4179 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink()
4188 btrfs_record_unlink_dir(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)), in btrfs_unlink()
4191 ret = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_unlink()
4192 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_unlink()
4198 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_unlink()
4212 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_unlink_subvol()
4213 struct btrfs_inode *inode = BTRFS_I(d_inode(dentry)); in btrfs_unlink_subvol()
4223 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); in btrfs_unlink_subvol()
4290 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); in btrfs_unlink_subvol()
4296 btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); in btrfs_unlink_subvol()
4299 ret = btrfs_update_inode_fallback(trans, root, BTRFS_I(dir)); in btrfs_unlink_subvol()
4429 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_delete_subvolume()
4431 struct btrfs_root *dest = BTRFS_I(inode)->root; in btrfs_delete_subvolume()
4479 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); in btrfs_delete_subvolume()
4556 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_rmdir()
4562 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) in btrfs_rmdir()
4569 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { in btrfs_rmdir()
4574 err = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_rmdir()
4578 last_unlink_trans = BTRFS_I(inode)->last_unlink_trans; in btrfs_rmdir()
4581 err = btrfs_unlink_inode(trans, root, BTRFS_I(dir), in btrfs_rmdir()
4582 BTRFS_I(d_inode(dentry)), dentry->d_name.name, in btrfs_rmdir()
4585 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_rmdir()
4598 BTRFS_I(dir)->last_unlink_trans = last_unlink_trans; in btrfs_rmdir()
5295 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setsize()
5324 ret = btrfs_cont_expand(BTRFS_I(inode), oldsize, newsize); in btrfs_setsize()
5337 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in btrfs_setsize()
5339 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_setsize()
5360 &BTRFS_I(inode)->runtime_flags); in btrfs_setsize()
5379 i_size_write(inode, BTRFS_I(inode)->disk_i_size); in btrfs_setsize()
5390 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_setattr()
5432 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in evict_inode_truncate_pages()
5433 struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; in evict_inode_truncate_pages()
5499 btrfs_qgroup_free_data(BTRFS_I(inode), NULL, start, in evict_inode_truncate_pages()
5568 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_evict_inode()
5585 btrfs_is_free_space_inode(BTRFS_I(inode)))) in btrfs_evict_inode()
5591 btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1); in btrfs_evict_inode()
5602 ret = btrfs_commit_inode_delayed_inode(BTRFS_I(inode)); in btrfs_evict_inode()
5612 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_evict_inode()
5621 ret = btrfs_truncate_inode_items(trans, root, BTRFS_I(inode), in btrfs_evict_inode()
5644 btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_evict_inode()
5657 btrfs_remove_delayed_node(BTRFS_I(inode)); in btrfs_evict_inode()
5676 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_inode_by_name()
5683 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5696 __func__, name, btrfs_ino(BTRFS_I(dir)), in btrfs_inode_by_name()
5732 key.objectid = BTRFS_I(dir)->root->root_key.objectid; in fixup_tree_root_location()
5745 if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || in fixup_tree_root_location()
5775 struct btrfs_root *root = BTRFS_I(inode)->root; in inode_tree_add()
5779 struct rb_node *new = &BTRFS_I(inode)->rb_node; in inode_tree_add()
5780 u64 ino = btrfs_ino(BTRFS_I(inode)); in inode_tree_add()
5837 BTRFS_I(inode)->location.objectid = args->ino; in btrfs_init_locked_inode()
5838 BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY; in btrfs_init_locked_inode()
5839 BTRFS_I(inode)->location.offset = 0; in btrfs_init_locked_inode()
5840 BTRFS_I(inode)->root = btrfs_grab_root(args->root); in btrfs_init_locked_inode()
5841 BUG_ON(args->root && !BTRFS_I(inode)->root); in btrfs_init_locked_inode()
5849 return args->ino == BTRFS_I(inode)->location.objectid && in btrfs_find_actor()
5850 args->root == BTRFS_I(inode)->root; in btrfs_find_actor()
5921 BTRFS_I(inode)->root = btrfs_grab_root(root); in new_simple_dir()
5922 memcpy(&BTRFS_I(inode)->location, key, sizeof(*key)); in new_simple_dir()
5923 set_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags); in new_simple_dir()
5937 BTRFS_I(inode)->i_otime = inode->i_mtime; in new_simple_dir()
5964 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_lookup_dentry()
6030 root = BTRFS_I(inode)->root; in btrfs_dentry_delete()
6034 if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_dentry_delete()
6103 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_real_readdir()
6139 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_real_readdir()
6248 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_dirty_inode()
6252 if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) in btrfs_dirty_inode()
6259 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_dirty_inode()
6267 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_dirty_inode()
6270 if (BTRFS_I(inode)->delayed_node) in btrfs_dirty_inode()
6283 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_update_time()
6384 args.ino = BTRFS_I(inode)->location.objectid; in btrfs_insert_inode_locked()
6385 args.root = BTRFS_I(inode)->root; in btrfs_insert_inode_locked()
6388 btrfs_inode_hash(inode->i_ino, BTRFS_I(inode)->root), in btrfs_insert_inode_locked()
6404 flags = BTRFS_I(dir)->flags; in btrfs_inherit_iflags()
6407 BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6408 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6410 BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS; in btrfs_inherit_iflags()
6411 BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS; in btrfs_inherit_iflags()
6415 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; in btrfs_inherit_iflags()
6417 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_inherit_iflags()
6472 ret = btrfs_set_inode_index(BTRFS_I(dir), index); in btrfs_new_inode()
6486 BTRFS_I(inode)->index_cnt = 2; in btrfs_new_inode()
6487 BTRFS_I(inode)->dir_index = *index; in btrfs_new_inode()
6488 BTRFS_I(inode)->root = btrfs_grab_root(root); in btrfs_new_inode()
6489 BTRFS_I(inode)->generation = trans->transid; in btrfs_new_inode()
6490 inode->i_generation = BTRFS_I(inode)->generation; in btrfs_new_inode()
6498 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_new_inode()
6520 location = &BTRFS_I(inode)->location; in btrfs_new_inode()
6541 BTRFS_I(inode)->i_otime = inode->i_mtime; in btrfs_new_inode()
6565 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; in btrfs_new_inode()
6567 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | in btrfs_new_inode()
6574 btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); in btrfs_new_inode()
6582 btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); in btrfs_new_inode()
6590 BTRFS_I(dir)->index_cnt--; in btrfs_new_inode()
6701 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mknod()
6722 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_mknod()
6742 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_mknod()
6747 btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_mknod()
6765 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_create()
6786 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_create()
6806 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_create()
6810 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_create()
6831 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_link()
6839 if (root->root_key.objectid != BTRFS_I(inode)->root->root_key.objectid) in btrfs_link()
6845 err = btrfs_set_inode_index(BTRFS_I(dir), &index); in btrfs_link()
6863 BTRFS_I(inode)->dir_index = 0ULL; in btrfs_link()
6868 set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); in btrfs_link()
6870 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, BTRFS_I(inode), in btrfs_link()
6878 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_link()
6886 err = btrfs_orphan_del(trans, BTRFS_I(inode)); in btrfs_link()
6891 btrfs_log_new_name(trans, BTRFS_I(inode), NULL, parent); in btrfs_link()
6911 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_mkdir()
6931 btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_mkdir()
6947 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_mkdir()
6948 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_mkdir()
6952 err = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), in btrfs_mkdir()
7477 struct btrfs_root *root = BTRFS_I(inode)->root; in can_nocow_extent()
7478 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in can_nocow_extent()
7487 bool nocow = (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW); in can_nocow_extent()
7494 btrfs_ino(BTRFS_I(inode)), offset, 0); in can_nocow_extent()
7510 if (key.objectid != btrfs_ino(BTRFS_I(inode)) || in can_nocow_extent()
7586 ret = btrfs_cross_ref_exist(root, btrfs_ino(BTRFS_I(inode)), in can_nocow_extent()
7622 lock_extent_bits(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7629 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), lockstart, in lock_extent_direct()
7644 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in lock_extent_direct()
7773 ((BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW) && in btrfs_get_blocks_direct_write()
7790 em2 = btrfs_create_dio_extent(BTRFS_I(inode), start, len, in btrfs_get_blocks_direct_write()
7816 *map = em = btrfs_new_extent_direct(BTRFS_I(inode), start, len); in btrfs_get_blocks_direct_write()
7864 &BTRFS_I(inode)->runtime_flags)) { in btrfs_dio_iomap_begin()
7878 ret = btrfs_delalloc_reserve_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7899 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_dio_iomap_begin()
7946 unlock_extent_cached(&BTRFS_I(inode)->io_tree, in btrfs_dio_iomap_begin()
7968 if (write && btrfs_use_zone_append(BTRFS_I(inode), em->block_start)) in btrfs_dio_iomap_begin()
7976 unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, in btrfs_dio_iomap_begin()
7980 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_begin()
7983 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->reserve); in btrfs_dio_iomap_begin()
8000 unlock_extent(&BTRFS_I(inode)->io_tree, pos, pos + length - 1); in btrfs_dio_iomap_end()
8008 __endio_write_update_ordered(BTRFS_I(inode), pos, in btrfs_dio_iomap_end()
8011 unlock_extent(&BTRFS_I(inode)->io_tree, pos, in btrfs_dio_iomap_end()
8018 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_dio_iomap_end()
8021 btrfs_delalloc_release_extents(BTRFS_I(inode), dio_data->length); in btrfs_dio_iomap_end()
8041 __endio_write_update_ordered(BTRFS_I(dip->inode), in btrfs_dio_private_put()
8046 unlock_extent(&BTRFS_I(dip->inode)->io_tree, in btrfs_dio_private_put()
8080 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_check_read_dio_bio()
8082 struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree; in btrfs_check_read_dio_bio()
8083 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_check_read_dio_bio()
8084 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_check_read_dio_bio()
8104 btrfs_ino(BTRFS_I(inode)), in btrfs_check_read_dio_bio()
8140 return btrfs_csum_one_bio(BTRFS_I(inode), bio, dio_file_offset, 1); in btrfs_submit_bio_start_direct_io()
8149 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
8151 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
8179 async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); in btrfs_submit_dio_bio()
8187 if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) in btrfs_submit_dio_bio()
8199 ret = btrfs_csum_one_bio(BTRFS_I(inode), bio, file_offset, 1); in btrfs_submit_dio_bio()
8225 const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); in btrfs_create_dio_private()
8276 unlock_extent(&BTRFS_I(inode)->io_tree, file_offset, in btrfs_submit_direct()
8327 status = extract_ordered_extent(BTRFS_I(inode), bio, in btrfs_submit_direct()
8404 return extent_fiemap(BTRFS_I(inode), fieinfo, start, len); in btrfs_fiemap()
8409 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_readpage()
8540 struct btrfs_inode *inode = BTRFS_I(page->mapping->host); in btrfs_invalidatepage()
8726 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_page_mkwrite()
8755 ret2 = btrfs_delalloc_reserve_space(BTRFS_I(inode), &data_reserved, in btrfs_page_mkwrite()
8770 down_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8793 ordered = btrfs_lookup_ordered_range(BTRFS_I(inode), page_start, in btrfs_page_mkwrite()
8799 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8810 btrfs_delalloc_release_space(BTRFS_I(inode), in btrfs_page_mkwrite()
8823 clear_extent_bit(&BTRFS_I(inode)->io_tree, page_start, end, in btrfs_page_mkwrite()
8827 ret2 = btrfs_set_extent_delalloc(BTRFS_I(inode), page_start, end, 0, in btrfs_page_mkwrite()
8850 btrfs_set_inode_last_sub_trans(BTRFS_I(inode)); in btrfs_page_mkwrite()
8853 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8855 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8862 up_read(&BTRFS_I(inode)->i_mmap_lock); in btrfs_page_mkwrite()
8864 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE); in btrfs_page_mkwrite()
8865 btrfs_delalloc_release_space(BTRFS_I(inode), data_reserved, page_start, in btrfs_page_mkwrite()
8876 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_truncate()
8943 ret = btrfs_truncate_inode_items(trans, root, BTRFS_I(inode), in btrfs_truncate()
8951 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_truncate()
8982 ret = btrfs_truncate_block(BTRFS_I(inode), inode->i_size, 0, 0); in btrfs_truncate()
8990 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in btrfs_truncate()
8997 ret2 = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_truncate()
9023 set_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &BTRFS_I(inode)->runtime_flags); in btrfs_truncate()
9055 btrfs_i_size_write(BTRFS_I(inode), 0); in btrfs_create_subvol_root()
9064 err = btrfs_update_inode(trans, new_root, BTRFS_I(inode)); in btrfs_create_subvol_root()
9135 btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); in btrfs_test_destroy_inode()
9136 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_test_destroy_inode()
9142 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); in btrfs_free_inode()
9148 struct btrfs_inode *inode = BTRFS_I(vfs_inode); in btrfs_destroy_inode()
9191 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_drop_inode()
9271 u32 bi_flags = BTRFS_I(inode)->flags; in btrfs_getattr()
9272 u32 bi_ro_flags = BTRFS_I(inode)->ro_flags; in btrfs_getattr()
9275 stat->btime.tv_sec = BTRFS_I(inode)->i_otime.tv_sec; in btrfs_getattr()
9276 stat->btime.tv_nsec = BTRFS_I(inode)->i_otime.tv_nsec; in btrfs_getattr()
9294 stat->dev = BTRFS_I(inode)->root->anon_dev; in btrfs_getattr()
9296 spin_lock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9297 delalloc_bytes = BTRFS_I(inode)->new_delalloc_bytes; in btrfs_getattr()
9299 spin_unlock(&BTRFS_I(inode)->lock); in btrfs_getattr()
9312 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename_exchange()
9313 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename_exchange()
9317 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename_exchange()
9318 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); in btrfs_rename_exchange()
9366 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &old_idx); in btrfs_rename_exchange()
9369 ret = btrfs_set_inode_index(BTRFS_I(old_dir), &new_idx); in btrfs_rename_exchange()
9373 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9374 BTRFS_I(new_inode)->dir_index = 0ULL; in btrfs_rename_exchange()
9385 btrfs_ino(BTRFS_I(new_dir)), in btrfs_rename_exchange()
9401 btrfs_ino(BTRFS_I(old_dir)), in btrfs_rename_exchange()
9421 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename_exchange()
9422 BTRFS_I(old_inode), 1); in btrfs_rename_exchange()
9423 btrfs_record_unlink_dir(trans, BTRFS_I(new_dir), in btrfs_rename_exchange()
9424 BTRFS_I(new_inode), 1); in btrfs_rename_exchange()
9454 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename_exchange()
9455 BTRFS_I(old_dentry->d_inode), in btrfs_rename_exchange()
9459 ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode)); in btrfs_rename_exchange()
9470 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename_exchange()
9471 BTRFS_I(new_dentry->d_inode), in btrfs_rename_exchange()
9475 ret = btrfs_update_inode(trans, dest, BTRFS_I(new_inode)); in btrfs_rename_exchange()
9482 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename_exchange()
9490 ret = btrfs_add_link(trans, BTRFS_I(old_dir), BTRFS_I(new_inode), in btrfs_rename_exchange()
9499 BTRFS_I(old_inode)->dir_index = old_idx; in btrfs_rename_exchange()
9501 BTRFS_I(new_inode)->dir_index = new_idx; in btrfs_rename_exchange()
9504 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename_exchange()
9510 btrfs_log_new_name(trans, BTRFS_I(new_inode), BTRFS_I(new_dir), in btrfs_rename_exchange()
9528 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename_exchange()
9529 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename_exchange()
9530 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename_exchange()
9531 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation)) in btrfs_rename_exchange()
9571 btrfs_ino(BTRFS_I(dir)), in btrfs_whiteout_for_rename()
9590 ret = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_whiteout_for_rename()
9591 BTRFS_I(inode), 0, index); in btrfs_whiteout_for_rename()
9595 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_whiteout_for_rename()
9613 struct btrfs_root *root = BTRFS_I(old_dir)->root; in btrfs_rename()
9614 struct btrfs_root *dest = BTRFS_I(new_dir)->root; in btrfs_rename()
9620 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); in btrfs_rename()
9623 if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) in btrfs_rename()
9631 (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) in btrfs_rename()
9694 ret = btrfs_set_inode_index(BTRFS_I(new_dir), &index); in btrfs_rename()
9698 BTRFS_I(old_inode)->dir_index = 0ULL; in btrfs_rename()
9707 btrfs_ino(BTRFS_I(new_dir)), index); in btrfs_rename()
9720 btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), in btrfs_rename()
9721 BTRFS_I(old_inode), 1); in btrfs_rename()
9745 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), in btrfs_rename()
9746 BTRFS_I(d_inode(old_dentry)), in btrfs_rename()
9750 ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode)); in btrfs_rename()
9760 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == in btrfs_rename()
9765 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), in btrfs_rename()
9766 BTRFS_I(d_inode(new_dentry)), in btrfs_rename()
9772 BTRFS_I(d_inode(new_dentry))); in btrfs_rename()
9779 ret = btrfs_add_link(trans, BTRFS_I(new_dir), BTRFS_I(old_inode), in btrfs_rename()
9788 BTRFS_I(old_inode)->dir_index = index; in btrfs_rename()
9791 btrfs_log_new_name(trans, BTRFS_I(old_inode), BTRFS_I(old_dir), in btrfs_rename()
9819 if (btrfs_inode_in_log(BTRFS_I(old_dir), fs_info->generation) || in btrfs_rename()
9820 btrfs_inode_in_log(BTRFS_I(new_dir), fs_info->generation) || in btrfs_rename()
9821 btrfs_inode_in_log(BTRFS_I(old_inode), fs_info->generation) || in btrfs_rename()
9823 btrfs_inode_in_log(BTRFS_I(new_inode), fs_info->generation))) in btrfs_rename()
9870 &BTRFS_I(inode)->runtime_flags)) in btrfs_run_delalloc_work()
10050 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_symlink()
10084 btrfs_ino(BTRFS_I(dir)), objectid, in btrfs_symlink()
10111 key.objectid = btrfs_ino(BTRFS_I(inode)); in btrfs_symlink()
10140 btrfs_i_size_write(BTRFS_I(inode), name_len); in btrfs_symlink()
10141 err = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_symlink()
10148 err = btrfs_add_nondir(trans, BTRFS_I(dir), dentry, in btrfs_symlink()
10149 BTRFS_I(inode), 0, index); in btrfs_symlink()
10247 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; in __btrfs_prealloc_file_range()
10249 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_prealloc_file_range()
10287 trans = insert_prealloc_file_extent(trans, BTRFS_I(inode), in __btrfs_prealloc_file_range()
10303 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10309 &BTRFS_I(inode)->runtime_flags); in __btrfs_prealloc_file_range()
10329 btrfs_drop_extent_cache(BTRFS_I(inode), cur_offset, in __btrfs_prealloc_file_range()
10341 BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; in __btrfs_prealloc_file_range()
10350 btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); in __btrfs_prealloc_file_range()
10353 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in __btrfs_prealloc_file_range()
10368 btrfs_free_reserved_data_space(BTRFS_I(inode), NULL, clear_offset, in __btrfs_prealloc_file_range()
10399 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_permission()
10406 if (BTRFS_I(inode)->flags & BTRFS_INODE_READONLY) in btrfs_permission()
10417 struct btrfs_root *root = BTRFS_I(dir)->root; in btrfs_tmpfile()
10435 btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); in btrfs_tmpfile()
10451 ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); in btrfs_tmpfile()
10454 ret = btrfs_orphan_add(trans, BTRFS_I(inode)); in btrfs_tmpfile()
10506 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_add_swapfile_pin()
10547 struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; in btrfs_free_swapfile_pins()
10616 atomic_dec(&BTRFS_I(inode)->root->nr_swapfiles); in btrfs_swap_deactivate()
10623 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_swap_activate()
10625 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in btrfs_swap_activate()
10648 if (BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS) { in btrfs_swap_activate()
10652 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW)) { in btrfs_swap_activate()
10656 if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) { in btrfs_swap_activate()
10706 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len); in btrfs_swap_activate()