aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-08-19 11:49:35 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:06 -0400
commit76fcef19c40328499a2f6d59d76b72fd03d2cc82 (patch)
tree1e9394a1cb42ae021f4eedac7954d69b23b062f4 /fs/btrfs
parent87acb4ef9b2991e1c453b78d71bce2ef994ef1ff (diff)
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/super.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 55f4d00fda3a..f7b3eac7ac6d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -451,21 +451,25 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
451 s->s_flags |= MS_ACTIVE; 451 s->s_flags |= MS_ACTIVE;
452 } 452 }
453 453
454 mutex_lock(&s->s_root->d_inode->i_mutex); 454 if (!strcmp(subvol_name, "."))
455 root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name)); 455 root = dget(s->s_root);
456 mutex_unlock(&s->s_root->d_inode->i_mutex); 456 else {
457 if (IS_ERR(root)) { 457 mutex_lock(&s->s_root->d_inode->i_mutex);
458 up_write(&s->s_umount); 458 root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name));
459 deactivate_super(s); 459 mutex_unlock(&s->s_root->d_inode->i_mutex);
460 error = PTR_ERR(root); 460 if (IS_ERR(root)) {
461 goto error; 461 up_write(&s->s_umount);
462 } 462 deactivate_super(s);
463 if (!root->d_inode) { 463 error = PTR_ERR(root);
464 dput(root); 464 goto error;
465 up_write(&s->s_umount); 465 }
466 deactivate_super(s); 466 if (!root->d_inode) {
467 error = -ENXIO; 467 dput(root);
468 goto error; 468 up_write(&s->s_umount);
469 deactivate_super(s);
470 error = -ENXIO;
471 goto error;
472 }
469 } 473 }
470 474
471 mnt->mnt_sb = s; 475 mnt->mnt_sb = s;