[WIP] [PATCH v3 08/12] erofs-utils: fuse: move erofs_init() to main.c

Gao Xiang hsiangkao at aol.com
Tue Nov 3 02:55:54 AEDT 2020


(will fold into the original patch.)

Signed-off-by: Gao Xiang <hsiangkao at aol.com>
---
 fuse/init.c | 10 ----------
 fuse/main.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/fuse/init.c b/fuse/init.c
index d67c7f0dd298..a5694beaf519 100644
--- a/fuse/init.c
+++ b/fuse/init.c
@@ -83,13 +83,3 @@ int erofs_read_superblock(void)
 	return 0;
 }
 
-void *erofs_init(struct fuse_conn_info *info)
-{
-	erofs_info("Using FUSE protocol %d.%d", info->proto_major, info->proto_minor);
-
-	if (inode_init(sbi.root_nid) != 0) {
-		erofs_err("inode initialization failed");
-		abort();
-	}
-	return NULL;
-}
diff --git a/fuse/main.c b/fuse/main.c
index fed4488081d8..30e4839bdcb4 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -13,6 +13,7 @@
 
 #include "erofs/print.h"
 #include "init.h"
+#include "namei.h"
 #include "read.h"
 #include "getattr.h"
 #include "open.h"
@@ -115,6 +116,17 @@ static void signal_handle_sigsegv(int signal)
 	abort();
 }
 
+void *erofs_init(struct fuse_conn_info *info)
+{
+	erofs_info("Using FUSE protocol %d.%d", info->proto_major, info->proto_minor);
+
+	if (inode_init(sbi.root_nid) != 0) {
+		erofs_err("inode initialization failed");
+		abort();
+	}
+	return NULL;
+}
+
 static struct fuse_operations erofs_ops = {
 	.readlink = erofs_readlink,
 	.getattr = erofs_getattr,
-- 
2.24.0



More information about the Linux-erofs mailing list