summaryrefslogtreecommitdiffstats
path: root/fs/logfs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-26 11: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)
downloadop-kernel-dev-7d945a3aa7608f68dba04083d3421e0b43052660.zip
op-kernel-dev-7d945a3aa7608f68dba04083d3421e0b43052660.tar.gz
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 c80837e..f57a150 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,
{
ulong mtdnr;
struct logfs_super *super;
+ int err;
super = kzalloc(sizeof(*super), GFP_KERNEL);
if (!super)
return -ENOMEM;
if (!devname)
- return logfs_get_sb_bdev(super, type, flags, devname, mnt);
- if (strncmp(devname, "mtd", 3))
- return logfs_get_sb_bdev(super, type, flags, devname, mnt);
-
- {
+ err = logfs_get_sb_bdev(super, type, devname);
+ else if (strncmp(devname, "mtd", 3))
+ err = logfs_get_sb_bdev(super, type, devname);
+ else {
char *garbage;
mtdnr = simple_strtoul(devname+3, &garbage, 0);
- if (*garbage) {
- kfree(super);
- return -EINVAL;
- }
+ if (*garbage)
+ err = -EINVAL;
+ else
+ err = logfs_get_sb_mtd(super, mtdnr);
+ }
+
+ if (err) {
+ kfree(super);
+ return err;
}
- return logfs_get_sb_mtd(super, type, flags, mtdnr, mnt);
+ return logfs_get_sb_device(super, type, flags, mnt);
}
static struct file_system_type logfs_fs_type = {
OpenPOWER on IntegriCloud