* [RFC 1/2] FS: mount_bdev from vfs instead of filesystem specific mount function.
@ 2015-01-19 20:47 Fabian Frederick
2015-01-19 21:10 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2015-01-19 20:47 UTC (permalink / raw)
To: linux-kernel; +Cc: Jan Kara, Alexander Viro, Fabian Frederick
Currently, a lot of filesystem mounting functions feature in
file_system_type only to be called from vfs mount_fs and call mount_bdev.
This patch adds fill_super function to that structure and lets vfs
call mount_bdev when no mount function is declared.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/super.c | 6 +++++-
include/linux/fs.h | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/super.c b/fs/super.c
index a89d625..7c37355 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1112,7 +1112,11 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
goto out_free_secdata;
}
- root = type->mount(type, flags, name, data);
+ if (type->mount)
+ root = type->mount(type, flags, name, data);
+ else
+ root = mount_bdev(type, flags, name, data, type->fill_super);
+
if (IS_ERR(root)) {
error = PTR_ERR(root);
goto out_free_secdata;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0bd9669..3e19349 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1846,8 +1846,10 @@ struct file_system_type {
#define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */
#define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */
#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */
+ int (*fill_super)(struct super_block *, void *, int);
struct dentry *(*mount) (struct file_system_type *, int,
const char *, void *);
+
void (*kill_sb) (struct super_block *);
struct module *owner;
struct file_system_type * next;
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [RFC 1/2] FS: mount_bdev from vfs instead of filesystem specific mount function.
2015-01-19 20:47 [RFC 1/2] FS: mount_bdev from vfs instead of filesystem specific mount function Fabian Frederick
@ 2015-01-19 21:10 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2015-01-19 21:10 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Jan Kara
On Mon, Jan 19, 2015 at 09:47:20PM +0100, Fabian Frederick wrote:
> Currently, a lot of filesystem mounting functions feature in
> file_system_type only to be called from vfs mount_fs and call mount_bdev.
>
> This patch adds fill_super function to that structure and lets vfs
> call mount_bdev when no mount function is declared.
NAK. First of all, quite a few of them are _not_ mount_bdev() users.
What's more, you are trading about 4 lines per filesystem (two of them
being { and }) for a layering violation.
No point whatsoever. fill_super() is no more a method than e.g. get_block().
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-19 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-19 20:47 [RFC 1/2] FS: mount_bdev from vfs instead of filesystem specific mount function Fabian Frederick
2015-01-19 21:10 ` Al Viro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.