mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00
btrfs: use struct btrfs_inode inside btrfs_get_parent()
Use a struct btrfs_inode to btrfs_get_parent() 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>
This commit is contained in:
parent
2d4323ced5
commit
8dddeb53ab
1 changed files with 5 additions and 5 deletions
|
@ -145,9 +145,9 @@ static struct dentry *btrfs_fh_to_dentry(struct super_block *sb, struct fid *fh,
|
|||
|
||||
struct dentry *btrfs_get_parent(struct dentry *child)
|
||||
{
|
||||
struct inode *dir = d_inode(child);
|
||||
struct btrfs_fs_info *fs_info = btrfs_sb(dir->i_sb);
|
||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
struct btrfs_inode *dir = BTRFS_I(d_inode(child));
|
||||
struct btrfs_root *root = dir->root;
|
||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
||||
struct btrfs_path *path;
|
||||
struct extent_buffer *leaf;
|
||||
struct btrfs_root_ref *ref;
|
||||
|
@ -159,13 +159,13 @@ struct dentry *btrfs_get_parent(struct dentry *child)
|
|||
if (!path)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
if (btrfs_ino(BTRFS_I(dir)) == BTRFS_FIRST_FREE_OBJECTID) {
|
||||
if (btrfs_ino(dir) == BTRFS_FIRST_FREE_OBJECTID) {
|
||||
key.objectid = btrfs_root_id(root);
|
||||
key.type = BTRFS_ROOT_BACKREF_KEY;
|
||||
key.offset = (u64)-1;
|
||||
root = fs_info->tree_root;
|
||||
} else {
|
||||
key.objectid = btrfs_ino(BTRFS_I(dir));
|
||||
key.objectid = btrfs_ino(dir);
|
||||
key.type = BTRFS_INODE_REF_KEY;
|
||||
key.offset = (u64)-1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue