[WIP] [PATCH v4 07/12] erofs-utils: fuse: move namei.c to lib/

Gao Xiang hsiangkao at aol.com
Sun Nov 15 05:25:12 AEDT 2020


Signed-off-by: Gao Xiang <hsiangkao at aol.com>
---
 fuse/Makefile.am         |  2 +-
 fuse/main.c              |  1 -
 fuse/namei.h             | 14 --------------
 fuse/read.c              |  1 -
 fuse/readir.c            |  1 -
 include/erofs/internal.h |  3 +++
 lib/Makefile.am          |  2 +-
 {fuse => lib}/namei.c    |  3 +--
 8 files changed, 6 insertions(+), 21 deletions(-)
 delete mode 100644 fuse/namei.h
 rename {fuse => lib}/namei.c (98%)

diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index d6e6d60cbfdc..f37069ff7f12 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -3,7 +3,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = erofsfuse
-erofsfuse_SOURCES = main.c namei.c read.c readir.c
+erofsfuse_SOURCES = main.c read.c readir.c
 erofsfuse_CFLAGS = -Wall -Werror \
                    -I$(top_srcdir)/include \
                    $(shell pkg-config fuse --cflags) \
diff --git a/fuse/main.c b/fuse/main.c
index 6176e836c2f1..fee90154a251 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -12,7 +12,6 @@
 #include <stddef.h>
 
 #include "erofs/print.h"
-#include "namei.h"
 #include "read.h"
 #include "readir.h"
 #include "erofs/io.h"
diff --git a/fuse/namei.h b/fuse/namei.h
deleted file mode 100644
index 730caf0085f7..000000000000
--- a/fuse/namei.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * erofs-utils/fuse/inode.h
- *
- * Created by Li Guifu <blucerlee at gmail.com>
- */
-#ifndef __INODE_H
-#define __INODE_H
-
-#include "erofs/internal.h"
-
-int erofs_ilookup(const char *path, struct erofs_inode *vi);
-
-#endif
diff --git a/fuse/read.c b/fuse/read.c
index 4e0058c01e81..2ef979ddba63 100644
--- a/fuse/read.c
+++ b/fuse/read.c
@@ -14,7 +14,6 @@
 #include "erofs/defs.h"
 #include "erofs/internal.h"
 #include "erofs/print.h"
-#include "namei.h"
 #include "erofs/io.h"
 #include "erofs/decompress.h"
 
diff --git a/fuse/readir.c b/fuse/readir.c
index 510aa7ebaf11..a405dd702d84 100644
--- a/fuse/readir.c
+++ b/fuse/readir.c
@@ -12,7 +12,6 @@
 #include "erofs/defs.h"
 #include "erofs/internal.h"
 #include "erofs_fs.h"
-#include "namei.h"
 #include "erofs/io.h"
 #include "erofs/print.h"
 
diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index 573ebfc298b5..7357ed75e3f8 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -241,6 +241,9 @@ struct erofs_map_blocks {
 /* super.c */
 int erofs_read_superblock(void);
 
+/* namei.c */
+int erofs_ilookup(const char *path, struct erofs_inode *vi);
+
 /* data.c */
 int erofs_read_raw_data(struct erofs_inode *inode, char *buffer,
 			erofs_off_t offset, erofs_off_t size);
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7d9446b3cbcf..f21dc35eda51 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -3,7 +3,7 @@
 
 noinst_LTLIBRARIES = liberofs.la
 liberofs_la_SOURCES = config.c io.c cache.c super.c inode.c xattr.c exclude.c \
-		      data.c compress.c compressor.c zmap.c decompress.c
+		      namei.c data.c compress.c compressor.c zmap.c decompress.c
 liberofs_la_CFLAGS = -Wall -Werror -I$(top_srcdir)/include
 if ENABLE_LZ4
 liberofs_la_CFLAGS += ${LZ4_CFLAGS}
diff --git a/fuse/namei.c b/lib/namei.c
similarity index 98%
rename from fuse/namei.c
rename to lib/namei.c
index 326ea85809bb..2e024d88d93e 100644
--- a/fuse/namei.c
+++ b/lib/namei.c
@@ -1,10 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/namei.c
+ * erofs-utils/lib/namei.c
  *
  * Created by Li Guifu <blucerlee at gmail.com>
  */
-#include "namei.h"
 #include <linux/kdev_t.h>
 #include <sys/types.h>
 #include <unistd.h>
-- 
2.24.0



More information about the Linux-erofs mailing list