Btrfs: Reinstate '-osubvol=.' option to mount entire tree

Date: Tue, 19 Aug 2008 16:49:35 +0100
This disappeared when I removed the special case for '.' in btrfs_lookup()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
David Woodhouse 2008-08-19 16:49:35 +01:00 committed by Chris Mason
parent 87acb4ef9b
commit 76fcef19c4

View File

@ -451,21 +451,25 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
} }
mutex_lock(&s->s_root->d_inode->i_mutex); if (!strcmp(subvol_name, "."))
root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name)); root = dget(s->s_root);
mutex_unlock(&s->s_root->d_inode->i_mutex); else {
if (IS_ERR(root)) { mutex_lock(&s->s_root->d_inode->i_mutex);
up_write(&s->s_umount); root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name));
deactivate_super(s); mutex_unlock(&s->s_root->d_inode->i_mutex);
error = PTR_ERR(root); if (IS_ERR(root)) {
goto error; up_write(&s->s_umount);
} deactivate_super(s);
if (!root->d_inode) { error = PTR_ERR(root);
dput(root); goto error;
up_write(&s->s_umount); }
deactivate_super(s); if (!root->d_inode) {
error = -ENXIO; dput(root);
goto error; up_write(&s->s_umount);
deactivate_super(s);
error = -ENXIO;
goto error;
}
} }
mnt->mnt_sb = s; mnt->mnt_sb = s;