aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/dev_bdev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-07-26 11:25:05 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-29 04:16:41 -0400
commit71a1c0125f132b2a4656689ca585c5d8931e539c (patch)
tree5c33185d3b7b00d1e23e1725b70b5ef14795f5fc /fs/logfs/dev_bdev.c
parentd2d1ea93069bd7706206b9c124e438ab2795612c (diff)
downloadkernel_samsung_aries-71a1c0125f132b2a4656689ca585c5d8931e539c.zip
kernel_samsung_aries-71a1c0125f132b2a4656689ca585c5d8931e539c.tar.gz
kernel_samsung_aries-71a1c0125f132b2a4656689ca585c5d8931e539c.tar.bz2
logfs get_sb massage, part 1
move allocation of logfs_super to logfs_get_sb, pass it to logfs_get_sb_...(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/logfs/dev_bdev.c')
-rw-r--r--fs/logfs/dev_bdev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c
index 9bd2ce2..bca8e2a 100644
--- a/fs/logfs/dev_bdev.c
+++ b/fs/logfs/dev_bdev.c
@@ -9,6 +9,7 @@
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/buffer_head.h>
+#include <linux/slab.h>
#include <linux/gfp.h>
#define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1))
@@ -320,20 +321,23 @@ static const struct logfs_device_ops bd_devops = {
.put_device = bdev_put_device,
};
-int logfs_get_sb_bdev(struct file_system_type *type, int flags,
+int logfs_get_sb_bdev(struct logfs_super *p,
+ struct file_system_type *type, int flags,
const char *devname, struct vfsmount *mnt)
{
struct block_device *bdev;
bdev = open_bdev_exclusive(devname, FMODE_READ|FMODE_WRITE, type);
- if (IS_ERR(bdev))
+ if (IS_ERR(bdev)) {
+ kfree(p);
return PTR_ERR(bdev);
+ }
if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) {
int mtdnr = MINOR(bdev->bd_dev);
close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
- return logfs_get_sb_mtd(type, flags, mtdnr, mnt);
+ return logfs_get_sb_mtd(p, type, flags, mtdnr, mnt);
}
- return logfs_get_sb_device(type, flags, NULL, bdev, &bd_devops, mnt);
+ return logfs_get_sb_device(p, type, flags, NULL, bdev, &bd_devops, mnt);
}