Currently btrfs_ino takes a struct inode and this causes a lot of internal btrfs functions which consume this ino to take a VFS inode, rather than btrfs' own struct btrfs_inode. In order to fix this "leak" of VFS structs into the internals of btrfs first it's necessary to eliminate all uses of struct inode for the purpose of inode. This patch does that by using BTRFS_I to convert an inode to btrfs_inode. With this problem eliminated subsequent patches will start eliminating the passing of struct inode altogether, eventually resulting in a lot cleaner code.
Unified · Split
| @@ -224,16 +224,16 @@ static inline void btrfs_insert_inode_hash(struct inode *inode) · 223 unmodified lines | ||
| 224 | 224 | __insert_inode_hash(inode, h); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | −static inline u64 btrfs_ino(struct inode *inode) | |
| 227 | +static inline u64 btrfs_ino(struct btrfs_inode *inode) | |
| 228 | 228 | { |
| 229 | − u64 ino = BTRFS_I(inode)->location.objectid; | |
| 229 | + u64 ino = inode->location.objectid; | |
| 230 | 230 | |
| 231 | 231 | /* |
| 232 | 232 | * !ino: btree_inode |
| 233 | 233 | * type == BTRFS_ROOT_ITEM_KEY: subvol dir |
| 234 | 234 | */ |
| 235 | − if (!ino || BTRFS_I(inode)->location.type == BTRFS_ROOT_ITEM_KEY) | |
| 236 | − ino = inode->i_ino; | |
| 235 | + if (!ino || inode->location.type == BTRFS_ROOT_ITEM_KEY) | |
| 236 | + ino = inode->vfs_inode.i_ino; | |
| 237 | 237 | return ino; |
| 238 | 238 | } |
| 239 | 239 | |
| @@ -248,7 +248,7 @@ static inline bool btrfs_is_free_space_inode(struct inode *inode) · 8 unmodified lines | ||
| 248 | 248 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 249 | 249 | |
| 250 | 250 | if (root == root->fs_info->tree_root && |
| 251 | − btrfs_ino(inode) != BTRFS_BTREE_INODE_OBJECTID) | |
| 251 | + btrfs_ino(BTRFS_I(inode)) != BTRFS_BTREE_INODE_OBJECTID) | |
| 252 | 252 | return true; |
| 253 | 253 | if (BTRFS_I(inode)->location.objectid == BTRFS_FREE_INO_OBJECTID) |
| 254 | 254 | return true; |
| @@ -126,7 +126,7 @@ static int check_compressed_csum(struct inode *inode, · 125 unmodified lines | ||
| 126 | 126 | if (csum != *cb_sum) { |
| 127 | 127 | btrfs_info(BTRFS_I(inode)->root->fs_info, |
| 128 | 128 | "csum failed ino %llu extent %llu csum %u wanted %u mirror %d", |
| 129 | − btrfs_ino(inode), disk_start, csum, *cb_sum, | |
| 129 | + btrfs_ino(BTRFS_I(inode)), disk_start, csum, *cb_sum, | |
| 130 | 130 | cb->mirror_num); |
| 131 | 131 | ret = -EIO; |
| 132 | 132 | goto fail; |
| @@ -76,7 +76,7 @@ static struct btrfs_delayed_node *btrfs_get_delayed_node(struct inode *inode) · 75 unmodified lines | ||
| 76 | 76 | { |
| 77 | 77 | struct btrfs_inode *btrfs_inode = BTRFS_I(inode); |
| 78 | 78 | struct btrfs_root *root = btrfs_inode->root; |
| 79 | − u64 ino = btrfs_ino(inode); | |
| 79 | + u64 ino = btrfs_ino(btrfs_inode); | |
| 80 | 80 | struct btrfs_delayed_node *node; |
| 81 | 81 | |
| 82 | 82 | node = READ_ONCE(btrfs_inode->delayed_node); |
| @@ -112,7 +112,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node( · 29 unmodified lines | ||
| 112 | 112 | struct btrfs_delayed_node *node; |
| 113 | 113 | struct btrfs_inode *btrfs_inode = BTRFS_I(inode); |
| 114 | 114 | struct btrfs_root *root = btrfs_inode->root; |
| 115 | − u64 ino = btrfs_ino(inode); | |
| 115 | + u64 ino = btrfs_ino(btrfs_inode); | |
| 116 | 116 | int ret; |
| 117 | 117 | |
| 118 | 118 | again: |
| @@ -637,7 +637,7 @@ static int btrfs_delayed_inode_reserve_metadata( · 518 unmodified lines | ||
| 637 | 637 | node->bytes_reserved = num_bytes; |
| 638 | 638 | trace_btrfs_space_reservation(fs_info, |
| 639 | 639 | "delayed_inode", |
| 640 | − btrfs_ino(inode), | |
| 640 | + btrfs_ino(BTRFS_I(inode)), | |
| 641 | 641 | num_bytes, 1); |
| 642 | 642 | } |
| 643 | 643 | return ret; |
| @@ -660,13 +660,13 @@ static int btrfs_delayed_inode_reserve_metadata( · 16 unmodified lines | ||
| 660 | 660 | */ |
| 661 | 661 | if (!ret) { |
| 662 | 662 | trace_btrfs_space_reservation(fs_info, "delayed_inode", |
| 663 | − btrfs_ino(inode), num_bytes, 1); | |
| 663 | + btrfs_ino(BTRFS_I(inode)), num_bytes, 1); | |
| 664 | 664 | node->bytes_reserved = num_bytes; |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | if (release) { |
| 668 | 668 | trace_btrfs_space_reservation(fs_info, "delalloc", |
| 669 | − btrfs_ino(inode), num_bytes, 0); | |
| 669 | + btrfs_ino(BTRFS_I(inode)), num_bytes, 0); | |
| 670 | 670 | btrfs_block_rsv_release(fs_info, src_rsv, num_bytes); |
| 671 | 671 | } |
| 672 | 672 | |
| @@ -1453,7 +1453,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans, · 780 unmodified lines | ||
| 1453 | 1453 | goto release_node; |
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | − delayed_item->key.objectid = btrfs_ino(dir); | |
| 1456 | + delayed_item->key.objectid = btrfs_ino(BTRFS_I(dir)); | |
| 1457 | 1457 | delayed_item->key.type = BTRFS_DIR_INDEX_KEY; |
| 1458 | 1458 | delayed_item->key.offset = index; |
| 1459 | 1459 | |
| @@ -1521,7 +1521,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans, · 61 unmodified lines | ||
| 1521 | 1521 | if (IS_ERR(node)) |
| 1522 | 1522 | return PTR_ERR(node); |
| 1523 | 1523 | |
| 1524 | − item_key.objectid = btrfs_ino(dir); | |
| 1524 | + item_key.objectid = btrfs_ino(BTRFS_I(dir)); | |
| 1525 | 1525 | item_key.type = BTRFS_DIR_INDEX_KEY; |
| 1526 | 1526 | item_key.offset = index; |
| 1527 | 1527 | |
| @@ -133,7 +133,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root · 132 unmodified lines | ||
| 133 | 133 | struct btrfs_disk_key disk_key; |
| 134 | 134 | u32 data_size; |
| 135 | 135 | |
| 136 | − key.objectid = btrfs_ino(dir); | |
| 136 | + key.objectid = btrfs_ino(BTRFS_I(dir)); | |
| 137 | 137 | key.type = BTRFS_DIR_ITEM_KEY; |
| 138 | 138 | key.offset = btrfs_name_hash(name, name_len); |
| 139 | 139 | |
| @@ -30,7 +30,7 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len, · 29 unmodified lines | ||
| 30 | 30 | len = BTRFS_FID_SIZE_NON_CONNECTABLE; |
| 31 | 31 | type = FILEID_BTRFS_WITHOUT_PARENT; |
| 32 | 32 | |
| 33 | − fid->objectid = btrfs_ino(inode); | |
| 33 | + fid->objectid = btrfs_ino(BTRFS_I(inode)); | |
| 34 | 34 | fid->root_objectid = BTRFS_I(inode)->root->objectid; |
| 35 | 35 | fid->gen = inode->i_generation; |
| 36 | 36 | |
| @@ -166,13 +166,13 @@ static struct dentry *btrfs_get_parent(struct dentry *child) · 129 unmodified lines | ||
| 166 | 166 | if (!path) |
| 167 | 167 | return ERR_PTR(-ENOMEM); |
| 168 | 168 | |
| 169 | − if (btrfs_ino(dir) == BTRFS_FIRST_FREE_OBJECTID) { | |
| 169 | + if (btrfs_ino(BTRFS_I(dir)) == BTRFS_FIRST_FREE_OBJECTID) { | |
| 170 | 170 | key.objectid = root->root_key.objectid; |
| 171 | 171 | key.type = BTRFS_ROOT_BACKREF_KEY; |
| 172 | 172 | key.offset = (u64)-1; |
| 173 | 173 | root = fs_info->tree_root; |
| 174 | 174 | } else { |
| 175 | − key.objectid = btrfs_ino(dir); | |
| 175 | + key.objectid = btrfs_ino(BTRFS_I(dir)); | |
| 176 | 176 | key.type = BTRFS_INODE_REF_KEY; |
| 177 | 177 | key.offset = (u64)-1; |
| 178 | 178 | } |
| @@ -238,7 +238,7 @@ static int btrfs_get_name(struct dentry *parent, char *name, · 59 unmodified lines | ||
| 238 | 238 | if (!S_ISDIR(dir->i_mode)) |
| 239 | 239 | return -EINVAL; |
| 240 | 240 | |
| 241 | − ino = btrfs_ino(inode); | |
| 241 | + ino = btrfs_ino(BTRFS_I(inode)); | |
| 242 | 242 | |
| 243 | 243 | path = btrfs_alloc_path(); |
| 244 | 244 | if (!path) |
| @@ -252,7 +252,7 @@ static int btrfs_get_name(struct dentry *parent, char *name, · 7 unmodified lines | ||
| 252 | 252 | root = fs_info->tree_root; |
| 253 | 253 | } else { |
| 254 | 254 | key.objectid = ino; |
| 255 | − key.offset = btrfs_ino(dir); | |
| 255 | + key.offset = btrfs_ino(BTRFS_I(dir)); | |
| 256 | 256 | key.type = BTRFS_INODE_REF_KEY; |
| 257 | 257 | } |
| 258 | 258 | |
| @@ -5756,7 +5756,7 @@ int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, · 5755 unmodified lines | ||
| 5756 | 5756 | u64 num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1); |
| 5757 | 5757 | |
| 5758 | 5758 | trace_btrfs_space_reservation(fs_info, "orphan", |
| 5759 | − btrfs_ino(inode), num_bytes, 1); | |
| 5759 | + btrfs_ino(BTRFS_I(inode)), num_bytes, 1); | |
| 5760 | 5760 | return btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); |
| 5761 | 5761 | } |
| 5762 | 5762 | |
| @@ -5767,7 +5767,7 @@ void btrfs_orphan_release_metadata(struct inode *inode) · 4 unmodified lines | ||
| 5767 | 5767 | u64 num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1); |
| 5768 | 5768 | |
| 5769 | 5769 | trace_btrfs_space_reservation(fs_info, "orphan", |
| 5770 | − btrfs_ino(inode), num_bytes, 0); | |
| 5770 | + btrfs_ino(BTRFS_I(inode)), num_bytes, 0); | |
| 5771 | 5771 | btrfs_block_rsv_release(fs_info, root->orphan_block_rsv, num_bytes); |
| 5772 | 5772 | } |
| 5773 | 5773 | |
| @@ -6001,7 +6001,7 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) · 227 unmodified lines | ||
| 6001 | 6001 | |
| 6002 | 6002 | if (to_reserve) |
| 6003 | 6003 | trace_btrfs_space_reservation(fs_info, "delalloc", |
| 6004 | − btrfs_ino(inode), to_reserve, 1); | |
| 6004 | + btrfs_ino(BTRFS_I(inode)), to_reserve, 1); | |
| 6005 | 6005 | if (release_extra) |
| 6006 | 6006 | btrfs_block_rsv_release(fs_info, block_rsv, |
| 6007 | 6007 | btrfs_calc_trans_metadata_size(fs_info, 1)); |
| @@ -6064,7 +6064,7 @@ out_fail: · 56 unmodified lines | ||
| 6064 | 6064 | if (to_free) { |
| 6065 | 6065 | btrfs_block_rsv_release(fs_info, block_rsv, to_free); |
| 6066 | 6066 | trace_btrfs_space_reservation(fs_info, "delalloc", |
| 6067 | − btrfs_ino(inode), to_free, 0); | |
| 6067 | + btrfs_ino(BTRFS_I(inode)), to_free, 0); | |
| 6068 | 6068 | } |
| 6069 | 6069 | if (delalloc_lock) |
| 6070 | 6070 | mutex_unlock(&BTRFS_I(inode)->delalloc_mutex); |
| @@ -6100,7 +6100,7 @@ void btrfs_delalloc_release_metadata(struct inode *inode, u64 num_bytes) · 29 unmodified lines | ||
| 6100 | 6100 | return; |
| 6101 | 6101 | |
| 6102 | 6102 | trace_btrfs_space_reservation(fs_info, "delalloc", |
| 6103 | − btrfs_ino(inode), to_free, 0); | |
| 6103 | + btrfs_ino(BTRFS_I(inode)), to_free, 0); | |
| 6104 | 6104 | |
| 6105 | 6105 | btrfs_block_rsv_release(fs_info, &fs_info->delalloc_block_rsv, to_free); |
| 6106 | 6106 | } |
| @@ -98,7 +98,7 @@ static inline void __btrfs_debug_check_extent_io_range(const char *caller, · 97 unmodified lines | ||
| 98 | 98 | if (end >= PAGE_SIZE && (end % 2) == 0 && end != isize - 1) { |
| 99 | 99 | btrfs_debug_rl(BTRFS_I(inode)->root->fs_info, |
| 100 | 100 | "%s: ino %llu isize %llu odd range [%llu,%llu]", |
| 101 | − caller, btrfs_ino(inode), isize, start, end); | |
| 101 | + caller, btrfs_ino(BTRFS_I(inode)), isize, start, end); | |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | #else |
| @@ -2065,7 +2065,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical, · 1960 unmodified lines | ||
| 2065 | 2065 | |
| 2066 | 2066 | btrfs_info_rl_in_rcu(fs_info, |
| 2067 | 2067 | "read error corrected: ino %llu off %llu (dev %s sector %llu)", |
| 2068 | − btrfs_ino(inode), start, | |
| 2068 | + btrfs_ino(BTRFS_I(inode)), start, | |
| 2069 | 2069 | rcu_str_deref(dev->name), sector); |
| 2070 | 2070 | btrfs_bio_counter_dec(fs_info); |
| 2071 | 2071 | bio_put(bio); |
| @@ -4413,7 +4413,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 2341 unmodified lines | ||
| 4413 | 4413 | * lookup the last file extent. We're not using i_size here |
| 4414 | 4414 | * because there might be preallocation past i_size |
| 4415 | 4415 | */ |
| 4416 | − ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(inode), -1, | |
| 4416 | + ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(inode)), -1, | |
| 4417 | 4417 | 0); |
| 4418 | 4418 | if (ret < 0) { |
| 4419 | 4419 | btrfs_free_path(path); |
| @@ -4429,7 +4429,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 9 unmodified lines | ||
| 4429 | 4429 | found_type = found_key.type; |
| 4430 | 4430 | |
| 4431 | 4431 | /* No extents, but there might be delalloc bits */ |
| 4432 | − if (found_key.objectid != btrfs_ino(inode) || | |
| 4432 | + if (found_key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 4433 | 4433 | found_type != BTRFS_EXTENT_DATA_KEY) { |
| 4434 | 4434 | /* have to trust i_size as the end */ |
| 4435 | 4435 | last = (u64)-1; |
| @@ -4539,7 +4539,7 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 103 unmodified lines | ||
| 4539 | 4539 | */ |
| 4540 | 4540 | ret = btrfs_check_shared(trans, root->fs_info, |
| 4541 | 4541 | root->objectid, |
| 4542 | − btrfs_ino(inode), bytenr); | |
| 4542 | + btrfs_ino(BTRFS_I(inode)), bytenr); | |
| 4543 | 4543 | if (trans) |
| 4544 | 4544 | btrfs_end_transaction(trans); |
| 4545 | 4545 | if (ret < 0) |
| @@ -255,7 +255,7 @@ static int __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio, · 254 unmodified lines | ||
| 255 | 255 | } else { |
| 256 | 256 | btrfs_info_rl(fs_info, |
| 257 | 257 | "no csum found for inode %llu start %llu", |
| 258 | − btrfs_ino(inode), offset); | |
| 258 | + btrfs_ino(BTRFS_I(inode)), offset); | |
| 259 | 259 | } |
| 260 | 260 | item = NULL; |
| 261 | 261 | btrfs_release_path(path); |
| @@ -977,7 +977,7 @@ void btrfs_extent_item_to_extent_map(struct inode *inode, · 715 unmodified lines | ||
| 977 | 977 | } else { |
| 978 | 978 | btrfs_err(fs_info, |
| 979 | 979 | "unknown file extent item type %d, inode %llu, offset %llu, root %llu", |
| 980 | − type, btrfs_ino(inode), extent_start, | |
| 980 | + type, btrfs_ino(BTRFS_I(inode)), extent_start, | |
| 981 | 981 | root->root_key.objectid); |
| 982 | 982 | } |
| 983 | 983 | } |
| @@ -168,7 +168,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, · 167 unmodified lines | ||
| 168 | 168 | if (!defrag) |
| 169 | 169 | return -ENOMEM; |
| 170 | 170 | |
| 171 | − defrag->ino = btrfs_ino(inode); | |
| 171 | + defrag->ino = btrfs_ino(BTRFS_I(inode)); | |
| 172 | 172 | defrag->transid = transid; |
| 173 | 173 | defrag->root = root->root_key.objectid; |
| 174 | 174 | |
| @@ -702,7 +702,7 @@ int __btrfs_drop_extents(struct btrfs_trans_handle *trans, · 527 unmodified lines | ||
| 702 | 702 | struct btrfs_file_extent_item *fi; |
| 703 | 703 | struct btrfs_key key; |
| 704 | 704 | struct btrfs_key new_key; |
| 705 | − u64 ino = btrfs_ino(inode); | |
| 705 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 706 | 706 | u64 search_start = start; |
| 707 | 707 | u64 disk_bytenr = 0; |
| 708 | 708 | u64 num_bytes = 0; |
| @@ -1102,7 +1102,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, · 393 unmodified lines | ||
| 1102 | 1102 | int del_slot = 0; |
| 1103 | 1103 | int recow; |
| 1104 | 1104 | int ret; |
| 1105 | − u64 ino = btrfs_ino(inode); | |
| 1105 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 1106 | 1106 | |
| 1107 | 1107 | path = btrfs_alloc_path(); |
| 1108 | 1108 | if (!path) |
| @@ -2203,7 +2203,7 @@ static int hole_mergeable(struct inode *inode, struct extent_buffer *leaf, · 1094 unmodified lines | ||
| 2203 | 2203 | return 0; |
| 2204 | 2204 | |
| 2205 | 2205 | btrfs_item_key_to_cpu(leaf, &key, slot); |
| 2206 | − if (key.objectid != btrfs_ino(inode) || | |
| 2206 | + if (key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 2207 | 2207 | key.type != BTRFS_EXTENT_DATA_KEY) |
| 2208 | 2208 | return 0; |
| 2209 | 2209 | |
| @@ -2237,7 +2237,7 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode, · 27 unmodified lines | ||
| 2237 | 2237 | if (btrfs_fs_incompat(fs_info, NO_HOLES)) |
| 2238 | 2238 | goto out; |
| 2239 | 2239 | |
| 2240 | − key.objectid = btrfs_ino(inode); | |
| 2240 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 2241 | 2241 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 2242 | 2242 | key.offset = offset; |
| 2243 | 2243 | |
| @@ -2285,7 +2285,7 @@ static int fill_holes(struct btrfs_trans_handle *trans, struct inode *inode, · 41 unmodified lines | ||
| 2285 | 2285 | } |
| 2286 | 2286 | btrfs_release_path(path); |
| 2287 | 2287 | |
| 2288 | − ret = btrfs_insert_file_extent(trans, root, btrfs_ino(inode), offset, | |
| 2288 | + ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), offset, | |
| 2289 | 2289 | 0, 0, end - offset, 0, end - offset, |
| 2290 | 2290 | 0, 0, 0); |
| 2291 | 2291 | if (ret) |
| @@ -313,7 +313,7 @@ static int io_ctl_init(struct btrfs_io_ctl *io_ctl, struct inode *inode, · 312 unmodified lines | ||
| 313 | 313 | |
| 314 | 314 | num_pages = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); |
| 315 | 315 | |
| 316 | − if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) | |
| 316 | + if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FREE_INO_OBJECTID) | |
| 317 | 317 | check_crcs = 1; |
| 318 | 318 | |
| 319 | 319 | /* Make sure we can fit our crcs into the first page */ |
| @@ -166,7 +166,7 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans, · 165 unmodified lines | ||
| 166 | 166 | struct btrfs_key key; |
| 167 | 167 | size_t datasize; |
| 168 | 168 | |
| 169 | − key.objectid = btrfs_ino(inode); | |
| 169 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 170 | 170 | key.offset = start; |
| 171 | 171 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 172 | 172 | |
| @@ -1265,7 +1265,7 @@ static noinline int run_delalloc_nocow(struct inode *inode, · 1092 unmodified lines | ||
| 1265 | 1265 | int nocow; |
| 1266 | 1266 | int check_prev = 1; |
| 1267 | 1267 | bool nolock; |
| 1268 | − u64 ino = btrfs_ino(inode); | |
| 1268 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 1269 | 1269 | |
| 1270 | 1270 | path = btrfs_alloc_path(); |
| 1271 | 1271 | if (!path) { |
| @@ -2149,7 +2149,7 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans, · 877 unmodified lines | ||
| 2149 | 2149 | goto out; |
| 2150 | 2150 | |
| 2151 | 2151 | if (!extent_inserted) { |
| 2152 | − ins.objectid = btrfs_ino(inode); | |
| 2152 | + ins.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 2153 | 2153 | ins.offset = file_pos; |
| 2154 | 2154 | ins.type = BTRFS_EXTENT_DATA_KEY; |
| 2155 | 2155 | |
| @@ -2182,7 +2182,7 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans, · 26 unmodified lines | ||
| 2182 | 2182 | ins.offset = disk_num_bytes; |
| 2183 | 2183 | ins.type = BTRFS_EXTENT_ITEM_KEY; |
| 2184 | 2184 | ret = btrfs_alloc_reserved_file_extent(trans, root->root_key.objectid, |
| 2185 | − btrfs_ino(inode), file_pos, | |
| 2185 | + btrfs_ino(BTRFS_I(inode)), file_pos, | |
| 2186 | 2186 | ram_bytes, &ins); |
| 2187 | 2187 | /* |
| 2188 | 2188 | * Release the reserved range from inode dirty range map, as it is |
| @@ -2308,7 +2308,7 @@ static noinline int record_one_backref(u64 inum, u64 offset, u64 root_id, · 119 unmodified lines | ||
| 2308 | 2308 | u64 num_bytes; |
| 2309 | 2309 | |
| 2310 | 2310 | if (BTRFS_I(inode)->root->root_key.objectid == root_id && |
| 2311 | − inum == btrfs_ino(inode)) | |
| 2311 | + inum == btrfs_ino(BTRFS_I(inode))) | |
| 2312 | 2312 | return 0; |
| 2313 | 2313 | |
| 2314 | 2314 | key.objectid = root_id; |
| @@ -2577,7 +2577,7 @@ static noinline int relink_extent_backref(struct btrfs_path *path, · 262 unmodified lines | ||
| 2577 | 2577 | if (ret) |
| 2578 | 2578 | goto out_free_path; |
| 2579 | 2579 | again: |
| 2580 | − key.objectid = btrfs_ino(inode); | |
| 2580 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 2581 | 2581 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 2582 | 2582 | key.offset = start; |
| 2583 | 2583 | |
| @@ -2756,7 +2756,7 @@ record_old_file_extents(struct inode *inode, · 172 unmodified lines | ||
| 2756 | 2756 | if (!path) |
| 2757 | 2757 | goto out_kfree; |
| 2758 | 2758 | |
| 2759 | − key.objectid = btrfs_ino(inode); | |
| 2759 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 2760 | 2760 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 2761 | 2761 | key.offset = new->file_pos; |
| 2762 | 2762 | |
| @@ -2791,7 +2791,7 @@ record_old_file_extents(struct inode *inode, · 28 unmodified lines | ||
| 2791 | 2791 | |
| 2792 | 2792 | btrfs_item_key_to_cpu(l, &key, slot); |
| 2793 | 2793 | |
| 2794 | − if (key.objectid != btrfs_ino(inode)) | |
| 2794 | + if (key.objectid != btrfs_ino(BTRFS_I(inode))) | |
| 2795 | 2795 | break; |
| 2796 | 2796 | if (key.type != BTRFS_EXTENT_DATA_KEY) |
| 2797 | 2797 | break; |
| @@ -3113,7 +3113,7 @@ static int __readpage_endio_check(struct inode *inode, · 315 unmodified lines | ||
| 3113 | 3113 | zeroit: |
| 3114 | 3114 | btrfs_warn_rl(BTRFS_I(inode)->root->fs_info, |
| 3115 | 3115 | "csum failed ino %llu off %llu csum %u expected csum %u", |
| 3116 | − btrfs_ino(inode), start, csum, csum_expected); | |
| 3116 | + btrfs_ino(BTRFS_I(inode)), start, csum, csum_expected); | |
| 3117 | 3117 | memset(kaddr + pgoff, 1, len); |
| 3118 | 3118 | flush_dcache_page(page); |
| 3119 | 3119 | kunmap_atomic(kaddr); |
| @@ -3314,7 +3314,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) · 194 unmodified lines | ||
| 3314 | 3314 | |
| 3315 | 3315 | /* insert an orphan item to track this unlinked/truncated file */ |
| 3316 | 3316 | if (insert >= 1) { |
| 3317 | − ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(inode)); | |
| 3317 | + ret = btrfs_insert_orphan_item(trans, root, btrfs_ino(BTRFS_I(inode))); | |
| 3318 | 3318 | if (ret) { |
| 3319 | 3319 | atomic_dec(&root->orphan_inodes); |
| 3320 | 3320 | if (reserve) { |
| @@ -3370,7 +3370,7 @@ static int btrfs_orphan_del(struct btrfs_trans_handle *trans, · 49 unmodified lines | ||
| 3370 | 3370 | atomic_dec(&root->orphan_inodes); |
| 3371 | 3371 | if (trans) |
| 3372 | 3372 | ret = btrfs_del_orphan_item(trans, root, |
| 3373 | − btrfs_ino(inode)); | |
| 3373 | + btrfs_ino(BTRFS_I(inode))); | |
| 3374 | 3374 | } |
| 3375 | 3375 | |
| 3376 | 3376 | if (release_rsv) |
| @@ -3777,7 +3777,7 @@ cache_index: · 400 unmodified lines | ||
| 3777 | 3777 | goto cache_acl; |
| 3778 | 3778 | |
| 3779 | 3779 | btrfs_item_key_to_cpu(leaf, &location, path->slots[0]); |
| 3780 | − if (location.objectid != btrfs_ino(inode)) | |
| 3780 | + if (location.objectid != btrfs_ino(BTRFS_I(inode))) | |
| 3781 | 3781 | goto cache_acl; |
| 3782 | 3782 | |
| 3783 | 3783 | ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); |
| @@ -3799,14 +3799,14 @@ cache_acl: · 15 unmodified lines | ||
| 3799 | 3799 | * any xattrs or acls |
| 3800 | 3800 | */ |
| 3801 | 3801 | maybe_acls = acls_after_inode_item(leaf, path->slots[0], |
| 3802 | − btrfs_ino(inode), &first_xattr_slot); | |
| 3802 | + btrfs_ino(BTRFS_I(inode)), &first_xattr_slot); | |
| 3803 | 3803 | if (first_xattr_slot != -1) { |
| 3804 | 3804 | path->slots[0] = first_xattr_slot; |
| 3805 | 3805 | ret = btrfs_load_inode_props(inode, path); |
| 3806 | 3806 | if (ret) |
| 3807 | 3807 | btrfs_err(fs_info, |
| 3808 | 3808 | "error loading props for ino %llu (root %llu): %d", |
| 3809 | − btrfs_ino(inode), | |
| 3809 | + btrfs_ino(BTRFS_I(inode)), | |
| 3810 | 3810 | root->root_key.objectid, ret); |
| 3811 | 3811 | } |
| 3812 | 3812 | btrfs_free_path(path); |
| @@ -3991,8 +3991,8 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, · 178 unmodified lines | ||
| 3991 | 3991 | struct btrfs_dir_item *di; |
| 3992 | 3992 | struct btrfs_key key; |
| 3993 | 3993 | u64 index; |
| 3994 | − u64 ino = btrfs_ino(inode); | |
| 3995 | − u64 dir_ino = btrfs_ino(dir); | |
| 3994 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 3995 | + u64 dir_ino = btrfs_ino(BTRFS_I(dir)); | |
| 3996 | 3996 | |
| 3997 | 3997 | path = btrfs_alloc_path(); |
| 3998 | 3998 | if (!path) { |
| @@ -4158,7 +4158,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 159 unmodified lines | ||
| 4158 | 4158 | struct btrfs_key key; |
| 4159 | 4159 | u64 index; |
| 4160 | 4160 | int ret; |
| 4161 | − u64 dir_ino = btrfs_ino(dir); | |
| 4161 | + u64 dir_ino = btrfs_ino(BTRFS_I(dir)); | |
| 4162 | 4162 | |
| 4163 | 4163 | path = btrfs_alloc_path(); |
| 4164 | 4164 | if (!path) |
| @@ -4237,14 +4237,14 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · 72 unmodified lines | ||
| 4237 | 4237 | |
| 4238 | 4238 | if (inode->i_size > BTRFS_EMPTY_DIR_SIZE) |
| 4239 | 4239 | return -ENOTEMPTY; |
| 4240 | − if (btrfs_ino(inode) == BTRFS_FIRST_FREE_OBJECTID) | |
| 4240 | + if (btrfs_ino(BTRFS_I(inode)) == BTRFS_FIRST_FREE_OBJECTID) | |
| 4241 | 4241 | return -EPERM; |
| 4242 | 4242 | |
| 4243 | 4243 | trans = __unlink_start_trans(dir); |
| 4244 | 4244 | if (IS_ERR(trans)) |
| 4245 | 4245 | return PTR_ERR(trans); |
| 4246 | 4246 | |
| 4247 | − if (unlikely(btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { | |
| 4247 | + if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { | |
| 4248 | 4248 | err = btrfs_unlink_subvol(trans, root, dir, |
| 4249 | 4249 | BTRFS_I(inode)->location.objectid, |
| 4250 | 4250 | dentry->d_name.name, |
| @@ -4386,7 +4386,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, · 135 unmodified lines | ||
| 4386 | 4386 | int extent_type = -1; |
| 4387 | 4387 | int ret; |
| 4388 | 4388 | int err = 0; |
| 4389 | − u64 ino = btrfs_ino(inode); | |
| 4389 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 4390 | 4390 | u64 bytes_deleted = 0; |
| 4391 | 4391 | bool be_nice = 0; |
| 4392 | 4392 | bool should_throttle = 0; |
| @@ -4858,7 +4858,7 @@ static int maybe_insert_hole(struct btrfs_root *root, struct inode *inode, · 465 unmodified lines | ||
| 4858 | 4858 | return ret; |
| 4859 | 4859 | } |
| 4860 | 4860 | |
| 4861 | − ret = btrfs_insert_file_extent(trans, root, btrfs_ino(inode), offset, | |
| 4861 | + ret = btrfs_insert_file_extent(trans, root, btrfs_ino(BTRFS_I(inode)), offset, | |
| 4862 | 4862 | 0, 0, len, 0, len, 0, 0, 0); |
| 4863 | 4863 | if (ret) |
| 4864 | 4864 | btrfs_abort_transaction(trans, ret); |
| @@ -5390,7 +5390,7 @@ void btrfs_evict_inode(struct inode *inode) · 525 unmodified lines | ||
| 5390 | 5390 | trans->block_rsv = &fs_info->trans_block_rsv; |
| 5391 | 5391 | if (!(root == fs_info->tree_root || |
| 5392 | 5392 | root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID)) |
| 5393 | − btrfs_return_ino(root, btrfs_ino(inode)); | |
| 5393 | + btrfs_return_ino(root, btrfs_ino(BTRFS_I(inode))); | |
| 5394 | 5394 | |
| 5395 | 5395 | btrfs_end_transaction(trans); |
| 5396 | 5396 | btrfs_btree_balance_dirty(fs_info); |
| @@ -5417,7 +5417,7 @@ static int btrfs_inode_by_name(struct inode *dir, struct dentry *dentry, · 20 unmodified lines | ||
| 5417 | 5417 | if (!path) |
| 5418 | 5418 | return -ENOMEM; |
| 5419 | 5419 | |
| 5420 | − di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(dir), name, | |
| 5420 | + di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)), name, | |
| 5421 | 5421 | namelen, 0); |
| 5422 | 5422 | if (IS_ERR(di)) |
| 5423 | 5423 | ret = PTR_ERR(di); |
| @@ -5473,7 +5473,7 @@ static int fixup_tree_root_location(struct btrfs_fs_info *fs_info, · 49 unmodified lines | ||
| 5473 | 5473 | |
| 5474 | 5474 | leaf = path->nodes[0]; |
| 5475 | 5475 | ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref); |
| 5476 | − if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(dir) || | |
| 5476 | + if (btrfs_root_ref_dirid(leaf, ref) != btrfs_ino(BTRFS_I(dir)) || | |
| 5477 | 5477 | btrfs_root_ref_name_len(leaf, ref) != dentry->d_name.len) |
| 5478 | 5478 | goto out; |
| 5479 | 5479 | |
| @@ -5508,7 +5508,7 @@ static void inode_tree_add(struct inode *inode) · 28 unmodified lines | ||
| 5508 | 5508 | struct rb_node **p; |
| 5509 | 5509 | struct rb_node *parent; |
| 5510 | 5510 | struct rb_node *new = &BTRFS_I(inode)->rb_node; |
| 5511 | − u64 ino = btrfs_ino(inode); | |
| 5511 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 5512 | 5512 | |
| 5513 | 5513 | if (inode_unhashed(inode)) |
| 5514 | 5514 | return; |
| @@ -5519,9 +5519,9 @@ static void inode_tree_add(struct inode *inode) · 4 unmodified lines | ||
| 5519 | 5519 | parent = *p; |
| 5520 | 5520 | entry = rb_entry(parent, struct btrfs_inode, rb_node); |
| 5521 | 5521 | |
| 5522 | − if (ino < btrfs_ino(&entry->vfs_inode)) | |
| 5522 | + if (ino < btrfs_ino(BTRFS_I(&entry->vfs_inode))) | |
| 5523 | 5523 | p = &parent->rb_left; |
| 5524 | − else if (ino > btrfs_ino(&entry->vfs_inode)) | |
| 5524 | + else if (ino > btrfs_ino(BTRFS_I(&entry->vfs_inode))) | |
| 5525 | 5525 | p = &parent->rb_right; |
| 5526 | 5526 | else { |
| 5527 | 5527 | WARN_ON(!(entry->vfs_inode.i_state & |
| @@ -5581,9 +5581,9 @@ again: · 53 unmodified lines | ||
| 5581 | 5581 | prev = node; |
| 5582 | 5582 | entry = rb_entry(node, struct btrfs_inode, rb_node); |
| 5583 | 5583 | |
| 5584 | − if (objectid < btrfs_ino(&entry->vfs_inode)) | |
| 5584 | + if (objectid < btrfs_ino(BTRFS_I(&entry->vfs_inode))) | |
| 5585 | 5585 | node = node->rb_left; |
| 5586 | − else if (objectid > btrfs_ino(&entry->vfs_inode)) | |
| 5586 | + else if (objectid > btrfs_ino(BTRFS_I(&entry->vfs_inode))) | |
| 5587 | 5587 | node = node->rb_right; |
| 5588 | 5588 | else |
| 5589 | 5589 | break; |
| @@ -5591,7 +5591,7 @@ again: · 1 unmodified line | ||
| 5591 | 5591 | if (!node) { |
| 5592 | 5592 | while (prev) { |
| 5593 | 5593 | entry = rb_entry(prev, struct btrfs_inode, rb_node); |
| 5594 | − if (objectid <= btrfs_ino(&entry->vfs_inode)) { | |
| 5594 | + if (objectid <= btrfs_ino(BTRFS_I(&entry->vfs_inode))) { | |
| 5595 | 5595 | node = prev; |
| 5596 | 5596 | break; |
| 5597 | 5597 | } |
| @@ -5600,7 +5600,7 @@ again: · 2 unmodified lines | ||
| 5600 | 5600 | } |
| 5601 | 5601 | while (node) { |
| 5602 | 5602 | entry = rb_entry(node, struct btrfs_inode, rb_node); |
| 5603 | − objectid = btrfs_ino(&entry->vfs_inode) + 1; | |
| 5603 | + objectid = btrfs_ino(BTRFS_I(&entry->vfs_inode)) + 1; | |
| 5604 | 5604 | inode = igrab(&entry->vfs_inode); |
| 5605 | 5605 | if (inode) { |
| 5606 | 5606 | spin_unlock(&root->inode_lock); |
| @@ -5784,7 +5784,7 @@ static int btrfs_dentry_delete(const struct dentry *dentry) · 177 unmodified lines | ||
| 5784 | 5784 | if (btrfs_root_refs(&root->root_item) == 0) |
| 5785 | 5785 | return 1; |
| 5786 | 5786 | |
| 5787 | − if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) | |
| 5787 | + if (btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) | |
| 5788 | 5788 | return 1; |
| 5789 | 5789 | } |
| 5790 | 5790 | return 0; |
| @@ -5853,7 +5853,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx) · 62 unmodified lines | ||
| 5853 | 5853 | |
| 5854 | 5854 | key.type = BTRFS_DIR_INDEX_KEY; |
| 5855 | 5855 | key.offset = ctx->pos; |
| 5856 | − key.objectid = btrfs_ino(inode); | |
| 5856 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 5857 | 5857 | |
| 5858 | 5858 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
| 5859 | 5859 | if (ret < 0) |
| @@ -6050,7 +6050,7 @@ static int btrfs_set_inode_index_count(struct inode *inode) · 190 unmodified lines | ||
| 6050 | 6050 | struct extent_buffer *leaf; |
| 6051 | 6051 | int ret; |
| 6052 | 6052 | |
| 6053 | − key.objectid = btrfs_ino(inode); | |
| 6053 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 6054 | 6054 | key.type = BTRFS_DIR_INDEX_KEY; |
| 6055 | 6055 | key.offset = (u64)-1; |
| 6056 | 6056 | |
| @@ -6082,7 +6082,7 @@ static int btrfs_set_inode_index_count(struct inode *inode) · 25 unmodified lines | ||
| 6082 | 6082 | leaf = path->nodes[0]; |
| 6083 | 6083 | btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); |
| 6084 | 6084 | |
| 6085 | − if (found_key.objectid != btrfs_ino(inode) || | |
| 6085 | + if (found_key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 6086 | 6086 | found_key.type != BTRFS_DIR_INDEX_KEY) { |
| 6087 | 6087 | BTRFS_I(inode)->index_cnt = 2; |
| 6088 | 6088 | goto out; |
| @@ -6282,7 +6282,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, · 193 unmodified lines | ||
| 6282 | 6282 | if (ret) |
| 6283 | 6283 | btrfs_err(fs_info, |
| 6284 | 6284 | "error inheriting props for ino %llu (root %llu): %d", |
| 6285 | − btrfs_ino(inode), root->root_key.objectid, ret); | |
| 6285 | + btrfs_ino(BTRFS_I(inode)), root->root_key.objectid, ret); | |
| 6286 | 6286 | |
| 6287 | 6287 | return inode; |
| 6288 | 6288 | |
| @@ -6315,8 +6315,8 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, · 26 unmodified lines | ||
| 6315 | 6315 | int ret = 0; |
| 6316 | 6316 | struct btrfs_key key; |
| 6317 | 6317 | struct btrfs_root *root = BTRFS_I(parent_inode)->root; |
| 6318 | − u64 ino = btrfs_ino(inode); | |
| 6319 | − u64 parent_ino = btrfs_ino(parent_inode); | |
| 6318 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 6319 | + u64 parent_ino = btrfs_ino(BTRFS_I(parent_inode)); | |
| 6320 | 6320 | |
| 6321 | 6321 | if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { |
| 6322 | 6322 | memcpy(&key, &BTRFS_I(inode)->root->root_key, sizeof(key)); |
| @@ -6415,7 +6415,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, · 92 unmodified lines | ||
| 6415 | 6415 | goto out_unlock; |
| 6416 | 6416 | |
| 6417 | 6417 | inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, |
| 6418 | − dentry->d_name.len, btrfs_ino(dir), objectid, | |
| 6418 | + dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, | |
| 6419 | 6419 | mode, &index); |
| 6420 | 6420 | if (IS_ERR(inode)) { |
| 6421 | 6421 | err = PTR_ERR(inode); |
| @@ -6487,7 +6487,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, · 65 unmodified lines | ||
| 6487 | 6487 | goto out_unlock; |
| 6488 | 6488 | |
| 6489 | 6489 | inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, |
| 6490 | − dentry->d_name.len, btrfs_ino(dir), objectid, | |
| 6490 | + dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, | |
| 6491 | 6491 | mode, &index); |
| 6492 | 6492 | if (IS_ERR(inode)) { |
| 6493 | 6493 | err = PTR_ERR(inode); |
| @@ -6637,7 +6637,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) · 143 unmodified lines | ||
| 6637 | 6637 | goto out_fail; |
| 6638 | 6638 | |
| 6639 | 6639 | inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, |
| 6640 | − dentry->d_name.len, btrfs_ino(dir), objectid, | |
| 6640 | + dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, | |
| 6641 | 6641 | S_IFDIR | mode, &index); |
| 6642 | 6642 | if (IS_ERR(inode)) { |
| 6643 | 6643 | err = PTR_ERR(inode); |
| @@ -6798,7 +6798,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, · 154 unmodified lines | ||
| 6798 | 6798 | int err = 0; |
| 6799 | 6799 | u64 extent_start = 0; |
| 6800 | 6800 | u64 extent_end = 0; |
| 6801 | − u64 objectid = btrfs_ino(inode); | |
| 6801 | + u64 objectid = btrfs_ino(BTRFS_I(inode)); | |
| 6802 | 6802 | u32 found_type; |
| 6803 | 6803 | struct btrfs_path *path = NULL; |
| 6804 | 6804 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| @@ -7056,7 +7056,7 @@ insert: · 251 unmodified lines | ||
| 7056 | 7056 | write_unlock(&em_tree->lock); |
| 7057 | 7057 | out: |
| 7058 | 7058 | |
| 7059 | − trace_btrfs_get_extent(root, inode, em); | |
| 7059 | + trace_btrfs_get_extent(root, BTRFS_I(inode), em); | |
| 7060 | 7060 | |
| 7061 | 7061 | btrfs_free_path(path); |
| 7062 | 7062 | if (trans) { |
| @@ -7290,7 +7290,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, · 227 unmodified lines | ||
| 7290 | 7290 | if (!path) |
| 7291 | 7291 | return -ENOMEM; |
| 7292 | 7292 | |
| 7293 | − ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(inode), | |
| 7293 | + ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(inode)), | |
| 7294 | 7294 | offset, 0); |
| 7295 | 7295 | if (ret < 0) |
| 7296 | 7296 | goto out; |
| @@ -7307,7 +7307,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, · 10 unmodified lines | ||
| 7307 | 7307 | ret = 0; |
| 7308 | 7308 | leaf = path->nodes[0]; |
| 7309 | 7309 | btrfs_item_key_to_cpu(leaf, &key, slot); |
| 7310 | − if (key.objectid != btrfs_ino(inode) || | |
| 7310 | + if (key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 7311 | 7311 | key.type != BTRFS_EXTENT_DATA_KEY) { |
| 7312 | 7312 | /* not our file or wrong item type, must cow */ |
| 7313 | 7313 | goto out; |
| @@ -7379,7 +7379,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, · 65 unmodified lines | ||
| 7379 | 7379 | goto out; |
| 7380 | 7380 | } |
| 7381 | 7381 | |
| 7382 | − ret = btrfs_cross_ref_exist(trans, root, btrfs_ino(inode), | |
| 7382 | + ret = btrfs_cross_ref_exist(trans, root, btrfs_ino(BTRFS_I(inode)), | |
| 7383 | 7383 | key.offset - backref_offset, disk_bytenr); |
| 7384 | 7384 | btrfs_end_transaction(trans); |
| 7385 | 7385 | if (ret) { |
| @@ -8240,7 +8240,7 @@ static void btrfs_end_dio_bio(struct bio *bio) · 854 unmodified lines | ||
| 8240 | 8240 | if (err) |
| 8241 | 8241 | btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, |
| 8242 | 8242 | "direct IO failed ino %llu rw %d,%u sector %#Lx len %u err no %d", |
| 8243 | − btrfs_ino(dip->inode), bio_op(bio), bio->bi_opf, | |
| 8243 | + btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), bio->bi_opf, | |
| 8244 | 8244 | (unsigned long long)bio->bi_iter.bi_sector, |
| 8245 | 8245 | bio->bi_iter.bi_size, err); |
| 8246 | 8246 | |
| @@ -9368,7 +9368,7 @@ void btrfs_destroy_inode(struct inode *inode) · 1121 unmodified lines | ||
| 9368 | 9368 | if (test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, |
| 9369 | 9369 | &BTRFS_I(inode)->runtime_flags)) { |
| 9370 | 9370 | btrfs_info(fs_info, "inode %llu still on the orphan list", |
| 9371 | − btrfs_ino(inode)); | |
| 9371 | + btrfs_ino(BTRFS_I(inode))); | |
| 9372 | 9372 | atomic_dec(&root->orphan_inodes); |
| 9373 | 9373 | } |
| 9374 | 9374 | |
| @@ -9497,8 +9497,8 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 122 unmodified lines | ||
| 9497 | 9497 | struct inode *old_inode = old_dentry->d_inode; |
| 9498 | 9498 | struct timespec ctime = current_time(old_inode); |
| 9499 | 9499 | struct dentry *parent; |
| 9500 | − u64 old_ino = btrfs_ino(old_inode); | |
| 9501 | − u64 new_ino = btrfs_ino(new_inode); | |
| 9500 | + u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); | |
| 9501 | + u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); | |
| 9502 | 9502 | u64 old_idx = 0; |
| 9503 | 9503 | u64 new_idx = 0; |
| 9504 | 9504 | u64 root_objectid; |
| @@ -9555,7 +9555,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 50 unmodified lines | ||
| 9555 | 9555 | new_dentry->d_name.name, |
| 9556 | 9556 | new_dentry->d_name.len, |
| 9557 | 9557 | old_ino, |
| 9558 | − btrfs_ino(new_dir), old_idx); | |
| 9558 | + btrfs_ino(BTRFS_I(new_dir)), old_idx); | |
| 9559 | 9559 | if (ret) |
| 9560 | 9560 | goto out_fail; |
| 9561 | 9561 | } |
| @@ -9571,7 +9571,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 9 unmodified lines | ||
| 9571 | 9571 | old_dentry->d_name.name, |
| 9572 | 9572 | old_dentry->d_name.len, |
| 9573 | 9573 | new_ino, |
| 9574 | − btrfs_ino(old_dir), new_idx); | |
| 9574 | + btrfs_ino(BTRFS_I(old_dir)), new_idx); | |
| 9575 | 9575 | if (ret) |
| 9576 | 9576 | goto out_fail; |
| 9577 | 9577 | } |
| @@ -9720,7 +9720,7 @@ static int btrfs_whiteout_for_rename(struct btrfs_trans_handle *trans, · 142 unmodified lines | ||
| 9720 | 9720 | inode = btrfs_new_inode(trans, root, dir, |
| 9721 | 9721 | dentry->d_name.name, |
| 9722 | 9722 | dentry->d_name.len, |
| 9723 | − btrfs_ino(dir), | |
| 9723 | + btrfs_ino(BTRFS_I(dir)), | |
| 9724 | 9724 | objectid, |
| 9725 | 9725 | S_IFCHR | WHITEOUT_MODE, |
| 9726 | 9726 | &index); |
| @@ -9768,10 +9768,10 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 41 unmodified lines | ||
| 9768 | 9768 | u64 index = 0; |
| 9769 | 9769 | u64 root_objectid; |
| 9770 | 9770 | int ret; |
| 9771 | − u64 old_ino = btrfs_ino(old_inode); | |
| 9771 | + u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); | |
| 9772 | 9772 | bool log_pinned = false; |
| 9773 | 9773 | |
| 9774 | − if (btrfs_ino(new_dir) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) | |
| 9774 | + if (btrfs_ino(BTRFS_I(new_dir)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) | |
| 9775 | 9775 | return -EPERM; |
| 9776 | 9776 | |
| 9777 | 9777 | /* we only allow rename subvolume link between subvolumes */ |
| @@ -9779,7 +9779,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 1 unmodified line | ||
| 9779 | 9779 | return -EXDEV; |
| 9780 | 9780 | |
| 9781 | 9781 | if (old_ino == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID || |
| 9782 | − (new_inode && btrfs_ino(new_inode) == BTRFS_FIRST_FREE_OBJECTID)) | |
| 9782 | + (new_inode && btrfs_ino(BTRFS_I(new_inode)) == BTRFS_FIRST_FREE_OBJECTID)) | |
| 9783 | 9783 | return -ENOTEMPTY; |
| 9784 | 9784 | |
| 9785 | 9785 | if (S_ISDIR(old_inode->i_mode) && new_inode && |
| @@ -9854,7 +9854,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 68 unmodified lines | ||
| 9854 | 9854 | new_dentry->d_name.name, |
| 9855 | 9855 | new_dentry->d_name.len, |
| 9856 | 9856 | old_ino, |
| 9857 | − btrfs_ino(new_dir), index); | |
| 9857 | + btrfs_ino(BTRFS_I(new_dir)), index); | |
| 9858 | 9858 | if (ret) |
| 9859 | 9859 | goto out_fail; |
| 9860 | 9860 | } |
| @@ -9890,7 +9890,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 29 unmodified lines | ||
| 9890 | 9890 | if (new_inode) { |
| 9891 | 9891 | inode_inc_iversion(new_inode); |
| 9892 | 9892 | new_inode->i_ctime = current_time(new_inode); |
| 9893 | − if (unlikely(btrfs_ino(new_inode) == | |
| 9893 | + if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == | |
| 9894 | 9894 | BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { |
| 9895 | 9895 | root_objectid = BTRFS_I(new_inode)->location.objectid; |
| 9896 | 9896 | ret = btrfs_unlink_subvol(trans, dest, new_dir, |
| @@ -10221,7 +10221,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, · 324 unmodified lines | ||
| 10221 | 10221 | goto out_unlock; |
| 10222 | 10222 | |
| 10223 | 10223 | inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, |
| 10224 | − dentry->d_name.len, btrfs_ino(dir), objectid, | |
| 10224 | + dentry->d_name.len, btrfs_ino(BTRFS_I(dir)), objectid, | |
| 10225 | 10225 | S_IFLNK|S_IRWXUGO, &index); |
| 10226 | 10226 | if (IS_ERR(inode)) { |
| 10227 | 10227 | err = PTR_ERR(inode); |
| @@ -10248,7 +10248,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, · 20 unmodified lines | ||
| 10248 | 10248 | err = -ENOMEM; |
| 10249 | 10249 | goto out_unlock_inode; |
| 10250 | 10250 | } |
| 10251 | − key.objectid = btrfs_ino(inode); | |
| 10251 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 10252 | 10252 | key.offset = 0; |
| 10253 | 10253 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 10254 | 10254 | datasize = btrfs_file_extent_calc_inline_size(name_len); |
| @@ -10501,7 +10501,7 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) · 246 unmodified lines | ||
| 10501 | 10501 | goto out; |
| 10502 | 10502 | |
| 10503 | 10503 | inode = btrfs_new_inode(trans, root, dir, NULL, 0, |
| 10504 | − btrfs_ino(dir), objectid, mode, &index); | |
| 10504 | + btrfs_ino(BTRFS_I(dir)), objectid, mode, &index); | |
| 10505 | 10505 | if (IS_ERR(inode)) { |
| 10506 | 10506 | ret = PTR_ERR(inode); |
| 10507 | 10507 | inode = NULL; |
| @@ -601,7 +601,7 @@ static noinline int create_subvol(struct inode *dir, · 600 unmodified lines | ||
| 601 | 601 | |
| 602 | 602 | ret = btrfs_add_root_ref(trans, fs_info, |
| 603 | 603 | objectid, root->root_key.objectid, |
| 604 | − btrfs_ino(dir), index, name, namelen); | |
| 604 | + btrfs_ino(BTRFS_I(dir)), index, name, namelen); | |
| 605 | 605 | BUG_ON(ret); |
| 606 | 606 | |
| 607 | 607 | ret = btrfs_uuid_tree_add(trans, fs_info, root_item->uuid, |
| @@ -941,7 +941,7 @@ static int find_new_extents(struct btrfs_root *root, · 333 unmodified lines | ||
| 941 | 941 | struct btrfs_file_extent_item *extent; |
| 942 | 942 | int type; |
| 943 | 943 | int ret; |
| 944 | − u64 ino = btrfs_ino(inode); | |
| 944 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 945 | 945 | |
| 946 | 946 | path = btrfs_alloc_path(); |
| 947 | 947 | if (!path) |
| @@ -1780,7 +1780,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file, · 832 unmodified lines | ||
| 1780 | 1780 | int ret = 0; |
| 1781 | 1781 | u64 flags = 0; |
| 1782 | 1782 | |
| 1783 | − if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID) | |
| 1783 | + if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) | |
| 1784 | 1784 | return -EINVAL; |
| 1785 | 1785 | |
| 1786 | 1786 | down_read(&fs_info->subvol_sem); |
| @@ -1812,7 +1812,7 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, · 25 unmodified lines | ||
| 1812 | 1812 | if (ret) |
| 1813 | 1813 | goto out; |
| 1814 | 1814 | |
| 1815 | − if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 1815 | + if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 1816 | 1816 | ret = -EINVAL; |
| 1817 | 1817 | goto out_drop_write; |
| 1818 | 1818 | } |
| @@ -2446,7 +2446,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, · 627 unmodified lines | ||
| 2446 | 2446 | if (err) |
| 2447 | 2447 | goto out_dput; |
| 2448 | 2448 | |
| 2449 | − if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 2449 | + if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 2450 | 2450 | err = -EINVAL; |
| 2451 | 2451 | goto out_dput; |
| 2452 | 2452 | } |
| @@ -3417,7 +3417,7 @@ static int clone_copy_inline_extent(struct inode *src, · 964 unmodified lines | ||
| 3417 | 3417 | if (new_key->offset > 0) |
| 3418 | 3418 | return -EOPNOTSUPP; |
| 3419 | 3419 | |
| 3420 | − key.objectid = btrfs_ino(dst); | |
| 3420 | + key.objectid = btrfs_ino(BTRFS_I(dst)); | |
| 3421 | 3421 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 3422 | 3422 | key.offset = 0; |
| 3423 | 3423 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
| @@ -3432,7 +3432,7 @@ static int clone_copy_inline_extent(struct inode *src, · 8 unmodified lines | ||
| 3432 | 3432 | goto copy_inline_extent; |
| 3433 | 3433 | } |
| 3434 | 3434 | btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); |
| 3435 | − if (key.objectid == btrfs_ino(dst) && | |
| 3435 | + if (key.objectid == btrfs_ino(BTRFS_I(dst)) && | |
| 3436 | 3436 | key.type == BTRFS_EXTENT_DATA_KEY) { |
| 3437 | 3437 | ASSERT(key.offset > 0); |
| 3438 | 3438 | return -EOPNOTSUPP; |
| @@ -3466,7 +3466,7 @@ static int clone_copy_inline_extent(struct inode *src, · 27 unmodified lines | ||
| 3466 | 3466 | } else if (ret == 0) { |
| 3467 | 3467 | btrfs_item_key_to_cpu(path->nodes[0], &key, |
| 3468 | 3468 | path->slots[0]); |
| 3469 | − if (key.objectid == btrfs_ino(dst) && | |
| 3469 | + if (key.objectid == btrfs_ino(BTRFS_I(dst)) && | |
| 3470 | 3470 | key.type == BTRFS_EXTENT_DATA_KEY) |
| 3471 | 3471 | return -EOPNOTSUPP; |
| 3472 | 3472 | } |
| @@ -3560,7 +3560,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode, · 87 unmodified lines | ||
| 3560 | 3560 | |
| 3561 | 3561 | path->reada = READA_FORWARD; |
| 3562 | 3562 | /* clone data */ |
| 3563 | − key.objectid = btrfs_ino(src); | |
| 3563 | + key.objectid = btrfs_ino(BTRFS_I(src)); | |
| 3564 | 3564 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 3565 | 3565 | key.offset = off; |
| 3566 | 3566 | |
| @@ -3603,7 +3603,7 @@ process_slot: · 36 unmodified lines | ||
| 3603 | 3603 | |
| 3604 | 3604 | btrfs_item_key_to_cpu(leaf, &key, slot); |
| 3605 | 3605 | if (key.type > BTRFS_EXTENT_DATA_KEY || |
| 3606 | − key.objectid != btrfs_ino(src)) | |
| 3606 | + key.objectid != btrfs_ino(BTRFS_I(src))) | |
| 3607 | 3607 | break; |
| 3608 | 3608 | |
| 3609 | 3609 | if (key.type == BTRFS_EXTENT_DATA_KEY) { |
| @@ -3656,7 +3656,7 @@ process_slot: · 46 unmodified lines | ||
| 3656 | 3656 | path->leave_spinning = 0; |
| 3657 | 3657 | |
| 3658 | 3658 | memcpy(&new_key, &key, sizeof(new_key)); |
| 3659 | − new_key.objectid = btrfs_ino(inode); | |
| 3659 | + new_key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 3660 | 3660 | if (off <= key.offset) |
| 3661 | 3661 | new_key.offset = key.offset + destoff - off; |
| 3662 | 3662 | else |
| @@ -3746,7 +3746,7 @@ process_slot: · 83 unmodified lines | ||
| 3746 | 3746 | fs_info, |
| 3747 | 3747 | disko, diskl, 0, |
| 3748 | 3748 | root->root_key.objectid, |
| 3749 | − btrfs_ino(inode), | |
| 3749 | + btrfs_ino(BTRFS_I(inode)), | |
| 3750 | 3750 | new_key.offset - datao); |
| 3751 | 3751 | if (ret) { |
| 3752 | 3752 | btrfs_abort_transaction(trans, |
| @@ -5126,7 +5126,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, · 1373 unmodified lines | ||
| 5126 | 5126 | |
| 5127 | 5127 | down_write(&fs_info->subvol_sem); |
| 5128 | 5128 | |
| 5129 | − if (btrfs_ino(inode) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 5129 | + if (btrfs_ino(BTRFS_I(inode)) != BTRFS_FIRST_FREE_OBJECTID) { | |
| 5130 | 5130 | ret = -EINVAL; |
| 5131 | 5131 | goto out; |
| 5132 | 5132 | } |
| @@ -279,7 +279,7 @@ static void inode_prop_iterator(void *ctx, · 278 unmodified lines | ||
| 279 | 279 | if (unlikely(ret)) |
| 280 | 280 | btrfs_warn(root->fs_info, |
| 281 | 281 | "error applying prop %s to ino %llu (root %llu): %d", |
| 282 | − handler->xattr_name, btrfs_ino(inode), | |
| 282 | + handler->xattr_name, btrfs_ino(BTRFS_I(inode)), | |
| 283 | 283 | root->root_key.objectid, ret); |
| 284 | 284 | else |
| 285 | 285 | set_bit(BTRFS_INODE_HAS_PROPS, &BTRFS_I(inode)->runtime_flags); |
| @@ -288,7 +288,7 @@ static void inode_prop_iterator(void *ctx, · 2 unmodified lines | ||
| 288 | 288 | int btrfs_load_inode_props(struct inode *inode, struct btrfs_path *path) |
| 289 | 289 | { |
| 290 | 290 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 291 | − u64 ino = btrfs_ino(inode); | |
| 291 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 292 | 292 | int ret; |
| 293 | 293 | |
| 294 | 294 | ret = iterate_object_props(root, path, ino, inode_prop_iterator, inode); |
| @@ -1548,9 +1548,9 @@ again: · 1547 unmodified lines | ||
| 1548 | 1548 | prev = node; |
| 1549 | 1549 | entry = rb_entry(node, struct btrfs_inode, rb_node); |
| 1550 | 1550 | |
| 1551 | − if (objectid < btrfs_ino(&entry->vfs_inode)) | |
| 1551 | + if (objectid < btrfs_ino(entry)) | |
| 1552 | 1552 | node = node->rb_left; |
| 1553 | − else if (objectid > btrfs_ino(&entry->vfs_inode)) | |
| 1553 | + else if (objectid > btrfs_ino(entry)) | |
| 1554 | 1554 | node = node->rb_right; |
| 1555 | 1555 | else |
| 1556 | 1556 | break; |
| @@ -1558,7 +1558,7 @@ again: · 1 unmodified line | ||
| 1558 | 1558 | if (!node) { |
| 1559 | 1559 | while (prev) { |
| 1560 | 1560 | entry = rb_entry(prev, struct btrfs_inode, rb_node); |
| 1561 | − if (objectid <= btrfs_ino(&entry->vfs_inode)) { | |
| 1561 | + if (objectid <= btrfs_ino(entry)) { | |
| 1562 | 1562 | node = prev; |
| 1563 | 1563 | break; |
| 1564 | 1564 | } |
| @@ -1573,7 +1573,7 @@ again: · 8 unmodified lines | ||
| 1573 | 1573 | return inode; |
| 1574 | 1574 | } |
| 1575 | 1575 | |
| 1576 | − objectid = btrfs_ino(&entry->vfs_inode) + 1; | |
| 1576 | + objectid = btrfs_ino(entry) + 1; | |
| 1577 | 1577 | if (cond_resched_lock(&root->inode_lock)) |
| 1578 | 1578 | goto again; |
| 1579 | 1579 | |
| @@ -1609,7 +1609,7 @@ static int get_new_location(struct inode *reloc_inode, u64 *new_bytenr, · 29 unmodified lines | ||
| 1609 | 1609 | return -ENOMEM; |
| 1610 | 1610 | |
| 1611 | 1611 | bytenr -= BTRFS_I(reloc_inode)->index_cnt; |
| 1612 | − ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(reloc_inode), | |
| 1612 | + ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(BTRFS_I(reloc_inode)), | |
| 1613 | 1613 | bytenr, 0); |
| 1614 | 1614 | if (ret < 0) |
| 1615 | 1615 | goto out; |
| @@ -1698,11 +1698,11 @@ int replace_file_extents(struct btrfs_trans_handle *trans, · 82 unmodified lines | ||
| 1698 | 1698 | if (first) { |
| 1699 | 1699 | inode = find_next_inode(root, key.objectid); |
| 1700 | 1700 | first = 0; |
| 1701 | − } else if (inode && btrfs_ino(inode) < key.objectid) { | |
| 1701 | + } else if (inode && btrfs_ino(BTRFS_I(inode)) < key.objectid) { | |
| 1702 | 1702 | btrfs_add_delayed_iput(inode); |
| 1703 | 1703 | inode = find_next_inode(root, key.objectid); |
| 1704 | 1704 | } |
| 1705 | − if (inode && btrfs_ino(inode) == key.objectid) { | |
| 1705 | + if (inode && btrfs_ino(BTRFS_I(inode)) == key.objectid) { | |
| 1706 | 1706 | end = key.offset + |
| 1707 | 1707 | btrfs_file_extent_num_bytes(leaf, fi); |
| 1708 | 1708 | WARN_ON(!IS_ALIGNED(key.offset, |
| @@ -2088,7 +2088,7 @@ static int invalidate_extent_cache(struct btrfs_root *root, · 379 unmodified lines | ||
| 2088 | 2088 | inode = find_next_inode(root, objectid); |
| 2089 | 2089 | if (!inode) |
| 2090 | 2090 | break; |
| 2091 | − ino = btrfs_ino(inode); | |
| 2091 | + ino = btrfs_ino(BTRFS_I(inode)); | |
| 2092 | 2092 | |
| 2093 | 2093 | if (ino > max_key->objectid) { |
| 2094 | 2094 | iput(inode); |
| @@ -1504,7 +1504,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, · 1503 unmodified lines | ||
| 1504 | 1504 | |
| 1505 | 1505 | /* check if there is a file/dir which has the same name. */ |
| 1506 | 1506 | dir_item = btrfs_lookup_dir_item(NULL, parent_root, path, |
| 1507 | − btrfs_ino(parent_inode), | |
| 1507 | + btrfs_ino(BTRFS_I(parent_inode)), | |
| 1508 | 1508 | dentry->d_name.name, |
| 1509 | 1509 | dentry->d_name.len, 0); |
| 1510 | 1510 | if (dir_item != NULL && !IS_ERR(dir_item)) { |
| @@ -1598,7 +1598,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, · 87 unmodified lines | ||
| 1598 | 1598 | */ |
| 1599 | 1599 | ret = btrfs_add_root_ref(trans, fs_info, objectid, |
| 1600 | 1600 | parent_root->root_key.objectid, |
| 1601 | − btrfs_ino(parent_inode), index, | |
| 1601 | + btrfs_ino(BTRFS_I(parent_inode)), index, | |
| 1602 | 1602 | dentry->d_name.name, dentry->d_name.len); |
| 1603 | 1603 | if (ret) { |
| 1604 | 1604 | btrfs_abort_transaction(trans, ret); |
| @@ -631,7 +631,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, · 630 unmodified lines | ||
| 631 | 631 | * file. This must be done before the btrfs_drop_extents run |
| 632 | 632 | * so we don't try to drop this extent. |
| 633 | 633 | */ |
| 634 | − ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(inode), | |
| 634 | + ret = btrfs_lookup_file_extent(trans, root, path, btrfs_ino(BTRFS_I(inode)), | |
| 635 | 635 | start, 0); |
| 636 | 636 | |
| 637 | 637 | if (ret == 0 && |
| @@ -1148,7 +1148,7 @@ next: · 510 unmodified lines | ||
| 1148 | 1148 | btrfs_release_path(path); |
| 1149 | 1149 | |
| 1150 | 1150 | /* look for a conflicting sequence number */ |
| 1151 | − di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), | |
| 1151 | + di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(BTRFS_I(dir)), | |
| 1152 | 1152 | ref_index, name, namelen, 0); |
| 1153 | 1153 | if (di && !IS_ERR(di)) { |
| 1154 | 1154 | ret = drop_one_dir_item(trans, root, path, dir, di); |
| @@ -1158,7 +1158,7 @@ next: · 3 unmodified lines | ||
| 1158 | 1158 | btrfs_release_path(path); |
| 1159 | 1159 | |
| 1160 | 1160 | /* look for a conflicing name */ |
| 1161 | − di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), | |
| 1161 | + di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(BTRFS_I(dir)), | |
| 1162 | 1162 | name, namelen, 0); |
| 1163 | 1163 | if (di && !IS_ERR(di)) { |
| 1164 | 1164 | ret = drop_one_dir_item(trans, root, path, dir, di); |
| @@ -1295,7 +1295,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, · 130 unmodified lines | ||
| 1295 | 1295 | goto out; |
| 1296 | 1296 | |
| 1297 | 1297 | /* if we already have a perfect match, we're done */ |
| 1298 | − if (!inode_in_dir(root, path, btrfs_ino(dir), btrfs_ino(inode), | |
| 1298 | + if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), btrfs_ino(BTRFS_I(inode)), | |
| 1299 | 1299 | ref_index, name, namelen)) { |
| 1300 | 1300 | /* |
| 1301 | 1301 | * look for a conflicting back reference in the |
| @@ -1367,7 +1367,7 @@ static int count_inode_extrefs(struct btrfs_root *root, · 65 unmodified lines | ||
| 1367 | 1367 | unsigned int nlink = 0; |
| 1368 | 1368 | u32 item_size; |
| 1369 | 1369 | u32 cur_offset = 0; |
| 1370 | − u64 inode_objectid = btrfs_ino(inode); | |
| 1370 | + u64 inode_objectid = btrfs_ino(BTRFS_I(inode)); | |
| 1371 | 1371 | u64 offset = 0; |
| 1372 | 1372 | unsigned long ptr; |
| 1373 | 1373 | struct btrfs_inode_extref *extref; |
| @@ -1412,7 +1412,7 @@ static int count_inode_refs(struct btrfs_root *root, · 38 unmodified lines | ||
| 1412 | 1412 | unsigned long ptr; |
| 1413 | 1413 | unsigned long ptr_end; |
| 1414 | 1414 | int name_len; |
| 1415 | − u64 ino = btrfs_ino(inode); | |
| 1415 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 1416 | 1416 | |
| 1417 | 1417 | key.objectid = ino; |
| 1418 | 1418 | key.type = BTRFS_INODE_REF_KEY; |
| @@ -1477,7 +1477,7 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans, · 58 unmodified lines | ||
| 1477 | 1477 | struct btrfs_path *path; |
| 1478 | 1478 | int ret; |
| 1479 | 1479 | u64 nlink = 0; |
| 1480 | − u64 ino = btrfs_ino(inode); | |
| 1480 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 1481 | 1481 | |
| 1482 | 1482 | path = btrfs_alloc_path(); |
| 1483 | 1483 | if (!path) |
| @@ -3092,7 +3092,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, · 1608 unmodified lines | ||
| 3092 | 3092 | int ret; |
| 3093 | 3093 | int err = 0; |
| 3094 | 3094 | int bytes_del = 0; |
| 3095 | − u64 dir_ino = btrfs_ino(dir); | |
| 3095 | + u64 dir_ino = btrfs_ino(BTRFS_I(dir)); | |
| 3096 | 3096 | |
| 3097 | 3097 | if (BTRFS_I(dir)->logged_trans < trans->transid) |
| 3098 | 3098 | return 0; |
| @@ -3208,7 +3208,7 @@ int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, · 109 unmodified lines | ||
| 3208 | 3208 | log = root->log_root; |
| 3209 | 3209 | mutex_lock(&BTRFS_I(inode)->log_mutex); |
| 3210 | 3210 | |
| 3211 | − ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(inode), | |
| 3211 | + ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(BTRFS_I(inode)), | |
| 3212 | 3212 | dirid, &index); |
| 3213 | 3213 | mutex_unlock(&BTRFS_I(inode)->log_mutex); |
| 3214 | 3214 | if (ret == -ENOSPC) { |
| @@ -3275,7 +3275,7 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans, · 60 unmodified lines | ||
| 3275 | 3275 | int nritems; |
| 3276 | 3276 | u64 first_offset = min_offset; |
| 3277 | 3277 | u64 last_offset = (u64)-1; |
| 3278 | − u64 ino = btrfs_ino(inode); | |
| 3278 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 3279 | 3279 | |
| 3280 | 3280 | log = root->log_root; |
| 3281 | 3281 | |
| @@ -3792,7 +3792,7 @@ static noinline int copy_items(struct btrfs_trans_handle *trans, · 510 unmodified lines | ||
| 3792 | 3792 | src_path->slots[0]--; |
| 3793 | 3793 | src = src_path->nodes[0]; |
| 3794 | 3794 | btrfs_item_key_to_cpu(src, &key, src_path->slots[0]); |
| 3795 | − if (key.objectid != btrfs_ino(inode) || | |
| 3795 | + if (key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 3796 | 3796 | key.type != BTRFS_EXTENT_DATA_KEY) |
| 3797 | 3797 | goto fill_holes; |
| 3798 | 3798 | extent = btrfs_item_ptr(src, src_path->slots[0], |
| @@ -3857,7 +3857,7 @@ fill_holes: · 58 unmodified lines | ||
| 3857 | 3857 | btrfs_item_key_to_cpu(src, &key, i); |
| 3858 | 3858 | if (!btrfs_comp_cpu_keys(&key, &last_key)) |
| 3859 | 3859 | done = true; |
| 3860 | − if (key.objectid != btrfs_ino(inode) || | |
| 3860 | + if (key.objectid != btrfs_ino(BTRFS_I(inode)) || | |
| 3861 | 3861 | key.type != BTRFS_EXTENT_DATA_KEY) { |
| 3862 | 3862 | i++; |
| 3863 | 3863 | continue; |
| @@ -3880,7 +3880,7 @@ fill_holes: · 16 unmodified lines | ||
| 3880 | 3880 | } |
| 3881 | 3881 | offset = *last_extent; |
| 3882 | 3882 | len = key.offset - *last_extent; |
| 3883 | − ret = btrfs_insert_file_extent(trans, log, btrfs_ino(inode), | |
| 3883 | + ret = btrfs_insert_file_extent(trans, log, btrfs_ino(BTRFS_I(inode)), | |
| 3884 | 3884 | offset, 0, 0, len, 0, len, 0, |
| 3885 | 3885 | 0, 0); |
| 3886 | 3886 | if (ret) |
| @@ -4091,7 +4091,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans, · 204 unmodified lines | ||
| 4091 | 4091 | return ret; |
| 4092 | 4092 | |
| 4093 | 4093 | if (!extent_inserted) { |
| 4094 | − key.objectid = btrfs_ino(inode); | |
| 4094 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 4095 | 4095 | key.type = BTRFS_EXTENT_DATA_KEY; |
| 4096 | 4096 | key.offset = em->start; |
| 4097 | 4097 | |
| @@ -4247,7 +4247,7 @@ static int logged_inode_size(struct btrfs_root *log, struct inode *inode, · 149 unmodified lines | ||
| 4247 | 4247 | struct btrfs_key key; |
| 4248 | 4248 | int ret; |
| 4249 | 4249 | |
| 4250 | − key.objectid = btrfs_ino(inode); | |
| 4250 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 4251 | 4251 | key.type = BTRFS_INODE_ITEM_KEY; |
| 4252 | 4252 | key.offset = 0; |
| 4253 | 4253 | |
| @@ -4285,7 +4285,7 @@ static int btrfs_log_all_xattrs(struct btrfs_trans_handle *trans, · 31 unmodified lines | ||
| 4285 | 4285 | { |
| 4286 | 4286 | int ret; |
| 4287 | 4287 | struct btrfs_key key; |
| 4288 | − const u64 ino = btrfs_ino(inode); | |
| 4288 | + const u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 4289 | 4289 | int ins_nr = 0; |
| 4290 | 4290 | int start_slot = 0; |
| 4291 | 4291 | |
| @@ -4384,7 +4384,7 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans, · 92 unmodified lines | ||
| 4384 | 4384 | u64 hole_size; |
| 4385 | 4385 | struct extent_buffer *leaf; |
| 4386 | 4386 | struct btrfs_root *log = root->log_root; |
| 4387 | − const u64 ino = btrfs_ino(inode); | |
| 4387 | + const u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 4388 | 4388 | const u64 i_size = i_size_read(inode); |
| 4389 | 4389 | |
| 4390 | 4390 | if (!btrfs_fs_incompat(fs_info, NO_HOLES)) |
| @@ -4617,7 +4617,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, · 226 unmodified lines | ||
| 4617 | 4617 | int ins_start_slot = 0; |
| 4618 | 4618 | int ins_nr; |
| 4619 | 4619 | bool fast_search = false; |
| 4620 | − u64 ino = btrfs_ino(inode); | |
| 4620 | + u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 4621 | 4621 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
| 4622 | 4622 | u64 logged_isize = 0; |
| 4623 | 4623 | bool need_log_inode_item = true; |
| @@ -4775,7 +4775,7 @@ again: · 151 unmodified lines | ||
| 4775 | 4775 | err = ret; |
| 4776 | 4776 | goto out_unlock; |
| 4777 | 4777 | } else if (ret > 0 && ctx && |
| 4778 | − other_ino != btrfs_ino(ctx->inode)) { | |
| 4778 | + other_ino != btrfs_ino(BTRFS_I(ctx->inode))) { | |
| 4779 | 4779 | struct btrfs_key inode_key; |
| 4780 | 4780 | struct inode *other_inode; |
| 4781 | 4781 | |
| @@ -5178,7 +5178,7 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans, · 396 unmodified lines | ||
| 5178 | 5178 | btrfs_free_path(path); |
| 5179 | 5179 | return -ENOMEM; |
| 5180 | 5180 | } |
| 5181 | − dir_elem->ino = btrfs_ino(start_inode); | |
| 5181 | + dir_elem->ino = btrfs_ino(BTRFS_I(start_inode)); | |
| 5182 | 5182 | list_add_tail(&dir_elem->list, &dir_list); |
| 5183 | 5183 | |
| 5184 | 5184 | while (!list_empty(&dir_list)) { |
| @@ -5297,7 +5297,7 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans, · 112 unmodified lines | ||
| 5297 | 5297 | struct btrfs_path *path; |
| 5298 | 5298 | struct btrfs_key key; |
| 5299 | 5299 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 5300 | − const u64 ino = btrfs_ino(inode); | |
| 5300 | + const u64 ino = btrfs_ino(BTRFS_I(inode)); | |
| 5301 | 5301 | |
| 5302 | 5302 | path = btrfs_alloc_path(); |
| 5303 | 5303 | if (!path) |
| @@ -47,7 +47,7 @@ ssize_t __btrfs_getxattr(struct inode *inode, const char *name, · 46 unmodified lines | ||
| 47 | 47 | return -ENOMEM; |
| 48 | 48 | |
| 49 | 49 | /* lookup the xattr by name */ |
| 50 | − di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode), name, | |
| 50 | + di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)), name, | |
| 51 | 51 | strlen(name), 0); |
| 52 | 52 | if (!di) { |
| 53 | 53 | ret = -ENODATA; |
| @@ -108,7 +108,7 @@ static int do_setxattr(struct btrfs_trans_handle *trans, · 54 unmodified lines | ||
| 108 | 108 | path->skip_release_on_error = 1; |
| 109 | 109 | |
| 110 | 110 | if (!value) { |
| 111 | − di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(inode), | |
| 111 | + di = btrfs_lookup_xattr(trans, root, path, btrfs_ino(BTRFS_I(inode)), | |
| 112 | 112 | name, name_len, -1); |
| 113 | 113 | if (!di && (flags & XATTR_REPLACE)) |
| 114 | 114 | ret = -ENODATA; |
| @@ -128,7 +128,7 @@ static int do_setxattr(struct btrfs_trans_handle *trans, · 13 unmodified lines | ||
| 128 | 128 | */ |
| 129 | 129 | if (flags & XATTR_REPLACE) { |
| 130 | 130 | ASSERT(inode_is_locked(inode)); |
| 131 | − di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(inode), | |
| 131 | + di = btrfs_lookup_xattr(NULL, root, path, btrfs_ino(BTRFS_I(inode)), | |
| 132 | 132 | name, name_len, 0); |
| 133 | 133 | if (!di) |
| 134 | 134 | ret = -ENODATA; |
| @@ -140,7 +140,7 @@ static int do_setxattr(struct btrfs_trans_handle *trans, · 5 unmodified lines | ||
| 140 | 140 | di = NULL; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | − ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode), | |
| 143 | + ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(BTRFS_I(inode)), | |
| 144 | 144 | name, name_len, value, size); |
| 145 | 145 | if (ret == -EOVERFLOW) { |
| 146 | 146 | /* |
| @@ -278,7 +278,7 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) · 131 unmodified lines | ||
| 278 | 278 | * NOTE: we set key.offset = 0; because we want to start with the |
| 279 | 279 | * first xattr that we find and walk forward |
| 280 | 280 | */ |
| 281 | − key.objectid = btrfs_ino(inode); | |
| 281 | + key.objectid = btrfs_ino(BTRFS_I(inode)); | |
| 282 | 282 | key.type = BTRFS_XATTR_ITEM_KEY; |
| 283 | 283 | key.offset = 0; |
| 284 | 284 | |
| @@ -184,7 +184,7 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict, · 183 unmodified lines | ||
| 184 | 184 | |
| 185 | 185 | TRACE_EVENT_CONDITION(btrfs_get_extent, |
| 186 | 186 | |
| 187 | − TP_PROTO(struct btrfs_root *root, struct inode *inode, | |
| 187 | + TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode, | |
| 188 | 188 | struct extent_map *map), |
| 189 | 189 | |
| 190 | 190 | TP_ARGS(root, inode, map), |