aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-26 03:53:30 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-29 04:16:46 -0400
commit7d945a3aa7608f68dba04083d3421e0b43052660 (patch)
tree6d236bc977372f3c93cfde81e68ef46e55159eff /fs/logfs/super.c
parent0d85c799623cb6022adb1317ed2987ab9c097c2e (diff)
logfs get_sb, part 3
take logfs_get_sb_device() calls to logfs_get_sb() itself Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/logfs/super.c')
-rw-r--r--fs/logfs/super.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index c80837e54bb3..f57a150b4779 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -596,26 +596,31 @@ static int logfs_get_sb(struct file_system_type *type, int flags,
596{ 596{
597 ulong mtdnr; 597 ulong mtdnr;
598 struct logfs_super *super; 598 struct logfs_super *super;
599 int err;
599 600
600 super = kzalloc(sizeof(*super), GFP_KERNEL); 601 super = kzalloc(sizeof(*super), GFP_KERNEL);
601 if (!super) 602 if (!super)
602 return -ENOMEM; 603 return -ENOMEM;
603 604
604 if (!devname) 605 if (!devname)
605 return logfs_get_sb_bdev(super, type, flags, devname, mnt); 606 err = logfs_get_sb_bdev(super, type, devname);
606 if (strncmp(devname, "mtd", 3)) 607 else if (strncmp(devname, "mtd", 3))
607 return logfs_get_sb_bdev(super, type, flags, devname, mnt); 608 err = logfs_get_sb_bdev(super, type, devname);
608 609 else {
609 {
610 char *garbage; 610 char *garbage;
611 mtdnr = simple_strtoul(devname+3, &garbage, 0); 611 mtdnr = simple_strtoul(devname+3, &garbage, 0);
612 if (*garbage) { 612 if (*garbage)
613 kfree(super); 613 err = -EINVAL;
614 return -EINVAL; 614 else
615 } 615 err = logfs_get_sb_mtd(super, mtdnr);
616 }
617
618 if (err) {
619 kfree(super);
620 return err;
616 } 621 }
617 622
618 return logfs_get_sb_mtd(super, type, flags, mtdnr, mnt); 623 return logfs_get_sb_device(super, type, flags, mnt);
619} 624}
620 625
621static struct file_system_type logfs_fs_type = { 626static struct file_system_type logfs_fs_type = {