From 3cc4c6eb51df2c55281abd4ae95cd3e8bed5ee46 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 25 Jul 2011 15:40:35 -0400 Subject: [PATCH] --- yaml --- r: 274603 b: refs/heads/master c: ba5b8958dabbd7890a6929af1ffc0d87187765dc h: refs/heads/master i: 274601: 7b26aaab3c294ca9973bfc838a5098ca6a1dc7ee 274599: e4197190e2ef5afcf857472d328dc6185435333d v: v3 --- [refs] | 2 +- trunk/fs/btrfs/super.c | 25 +------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/[refs] b/[refs] index 6290783245ff..e2065ecdf552 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0cbbdf7c9c46467bfb7129c30236f36a679ab244 +refs/heads/master: ba5b8958dabbd7890a6929af1ffc0d87187765dc diff --git a/trunk/fs/btrfs/super.c b/trunk/fs/btrfs/super.c index 15634d4648d7..244fa46c50b8 100644 --- a/trunk/fs/btrfs/super.c +++ b/trunk/fs/btrfs/super.c @@ -492,7 +492,6 @@ static struct dentry *get_default_root(struct super_block *sb, struct btrfs_path *path; struct btrfs_key location; struct inode *inode; - struct dentry *dentry; u64 dir_id; int new = 0; @@ -566,29 +565,7 @@ static struct dentry *get_default_root(struct super_block *sb, return dget(sb->s_root); } - if (new) { - const struct qstr name = { .name = "/", .len = 1 }; - - /* - * New inode, we need to make the dentry a sibling of s_root so - * everything gets cleaned up properly on unmount. - */ - dentry = d_alloc(sb->s_root, &name); - if (!dentry) { - iput(inode); - return ERR_PTR(-ENOMEM); - } - d_splice_alias(inode, dentry); - } else { - /* - * We found the inode in cache, just find a dentry for it and - * put the reference to the inode we just got. - */ - dentry = d_find_alias(inode); - iput(inode); - } - - return dentry; + return d_obtain_alias(inode); } static int btrfs_fill_super(struct super_block *sb,