diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-07-26 03:25:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-29 04:16:41 -0400 |
commit | 71a1c0125f132b2a4656689ca585c5d8931e539c (patch) | |
tree | 5c33185d3b7b00d1e23e1725b70b5ef14795f5fc /fs/logfs/dev_bdev.c | |
parent | d2d1ea93069bd7706206b9c124e438ab2795612c (diff) |
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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 9bd2ce2a3040..bca8e2a8e55b 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/bio.h> | 9 | #include <linux/bio.h> |
10 | #include <linux/blkdev.h> | 10 | #include <linux/blkdev.h> |
11 | #include <linux/buffer_head.h> | 11 | #include <linux/buffer_head.h> |
12 | #include <linux/slab.h> | ||
12 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
13 | 14 | ||
14 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) | 15 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) |
@@ -320,20 +321,23 @@ static const struct logfs_device_ops bd_devops = { | |||
320 | .put_device = bdev_put_device, | 321 | .put_device = bdev_put_device, |
321 | }; | 322 | }; |
322 | 323 | ||
323 | int logfs_get_sb_bdev(struct file_system_type *type, int flags, | 324 | int logfs_get_sb_bdev(struct logfs_super *p, |
325 | struct file_system_type *type, int flags, | ||
324 | const char *devname, struct vfsmount *mnt) | 326 | const char *devname, struct vfsmount *mnt) |
325 | { | 327 | { |
326 | struct block_device *bdev; | 328 | struct block_device *bdev; |
327 | 329 | ||
328 | bdev = open_bdev_exclusive(devname, FMODE_READ|FMODE_WRITE, type); | 330 | bdev = open_bdev_exclusive(devname, FMODE_READ|FMODE_WRITE, type); |
329 | if (IS_ERR(bdev)) | 331 | if (IS_ERR(bdev)) { |
332 | kfree(p); | ||
330 | return PTR_ERR(bdev); | 333 | return PTR_ERR(bdev); |
334 | } | ||
331 | 335 | ||
332 | if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) { | 336 | if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) { |
333 | int mtdnr = MINOR(bdev->bd_dev); | 337 | int mtdnr = MINOR(bdev->bd_dev); |
334 | close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE); | 338 | close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE); |
335 | return logfs_get_sb_mtd(type, flags, mtdnr, mnt); | 339 | return logfs_get_sb_mtd(p, type, flags, mtdnr, mnt); |
336 | } | 340 | } |
337 | 341 | ||
338 | return logfs_get_sb_device(type, flags, NULL, bdev, &bd_devops, mnt); | 342 | return logfs_get_sb_device(p, type, flags, NULL, bdev, &bd_devops, mnt); |
339 | } | 343 | } |