[Devel] [PATCH] fuse: Try automatically load kio module
Kirill Tkhai
ktkhai at virtuozzo.com
Wed May 9 17:05:01 MSK 2018
Make admin and developer life easier: load the module
automatically, avoid manual modprobe.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
fs/fuse/inode.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f89bda719c71..9941561587ff 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -500,7 +500,8 @@ EXPORT_SYMBOL_GPL(fuse_unregister_kio);
static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
{
struct fuse_kio_ops *ops;
-
+ bool once = true;
+again:
mutex_lock(&fuse_mutex);
list_for_each_entry(ops, &fuse_kios_list, list) {
if (!strncmp(name, ops->name, FUSE_KIO_NAME) &&
@@ -511,6 +512,11 @@ static struct fuse_kio_ops *fuse_kio_get(struct fuse_conn *fc, char *name)
}
}
mutex_unlock(&fuse_mutex);
+ if (once) {
+ once = false;
+ request_module("fuse_kio_%s", name);
+ goto again;
+ }
return NULL;
}
More information about the Devel
mailing list