]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/btrfs/super.c
Btrfs: Reinstate '-osubvol=.' option to mount entire tree
[linux-2.6-omap-h63xx.git] / fs / btrfs / super.c
index 55f4d00fda3aeb7b1db287d8b15257114343bb54..f7b3eac7ac6d9e5934891c27220a85138158b6a1 100644 (file)
@@ -451,21 +451,25 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
                s->s_flags |= MS_ACTIVE;
        }
 
-       mutex_lock(&s->s_root->d_inode->i_mutex);
-       root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name));
-       mutex_unlock(&s->s_root->d_inode->i_mutex);
-       if (IS_ERR(root)) {
-               up_write(&s->s_umount);
-               deactivate_super(s);
-               error = PTR_ERR(root);
-               goto error;
-       }
-       if (!root->d_inode) {
-               dput(root);
-               up_write(&s->s_umount);
-               deactivate_super(s);
-               error = -ENXIO;
-               goto error;
+       if (!strcmp(subvol_name, "."))
+               root = dget(s->s_root);
+       else {
+               mutex_lock(&s->s_root->d_inode->i_mutex);
+               root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name));
+               mutex_unlock(&s->s_root->d_inode->i_mutex);
+               if (IS_ERR(root)) {
+                       up_write(&s->s_umount);
+                       deactivate_super(s);
+                       error = PTR_ERR(root);
+                       goto error;
+               }
+               if (!root->d_inode) {
+                       dput(root);
+                       up_write(&s->s_umount);
+                       deactivate_super(s);
+                       error = -ENXIO;
+                       goto error;
+               }
        }
 
        mnt->mnt_sb = s;