From: David Sterba Date: Tue, 18 Feb 2025 00:48:21 +0000 (+0100) Subject: btrfs: use struct btrfs_inode inside btrfs_get_name() X-Git-Tag: v6.15-rc1~152^2~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4bb776cbe4ce8ad5f71667a75d1a5bef53f399f;p=thirdparty%2Flinux.git 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 Signed-off-by: David Sterba --- diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index ab4d8625ad550..0c0b8db82df6c 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);