diff options
| author | David Sterba <dsterba@suse.com> | 2025-02-18 01:48:21 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-03-18 20:35:44 +0100 |
| commit | a4bb776cbe4ce8ad5f71667a75d1a5bef53f399f (patch) | |
| tree | 9ab19e6318e771d6a1d45eb86070eb7693708933 /fs/btrfs/export.c | |
| parent | 8dddeb53ab1e11ea8a5b634a2d16586e5f93cd18 (diff) | |
btrfs: use struct btrfs_inode inside btrfs_get_name()
Use a struct btrfs_inode in btrfs_get_name() as it's an internal
helper, allowing to remove some use of BTRFS_I.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/export.c')
| -rw-r--r-- | fs/btrfs/export.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index ab4d8625ad55..0c0b8db82df6 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c @@ -219,11 +219,11 @@ fail: static int btrfs_get_name(struct dentry *parent, char *name, struct dentry *child) { - struct inode *inode = d_inode(child); - struct inode *dir = d_inode(parent); - struct btrfs_fs_info *fs_info = inode_to_fs_info(inode); + struct btrfs_inode *inode = BTRFS_I(d_inode(child)); + struct btrfs_inode *dir = BTRFS_I(d_inode(parent)); + struct btrfs_root *root = dir->root; + struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_path *path; - struct btrfs_root *root = BTRFS_I(dir)->root; struct btrfs_inode_ref *iref; struct btrfs_root_ref *rref; struct extent_buffer *leaf; @@ -233,24 +233,24 @@ static int btrfs_get_name(struct dentry *parent, char *name, int ret; u64 ino; - if (!S_ISDIR(dir->i_mode)) + if (!S_ISDIR(dir->vfs_inode.i_mode)) return -EINVAL; - ino = btrfs_ino(BTRFS_I(inode)); + ino = btrfs_ino(inode); path = btrfs_alloc_path(); if (!path) return -ENOMEM; if (ino == BTRFS_FIRST_FREE_OBJECTID) { - key.objectid = btrfs_root_id(BTRFS_I(inode)->root); + key.objectid = btrfs_root_id(inode->root); key.type = BTRFS_ROOT_BACKREF_KEY; key.offset = (u64)-1; root = fs_info->tree_root; } else { key.objectid = ino; key.type = BTRFS_INODE_REF_KEY; - key.offset = btrfs_ino(BTRFS_I(dir)); + key.offset = btrfs_ino(dir); } ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |