[WIP] [PATCH v3 11/12] erofs-utils: fuse: kill open.c

Gao Xiang hsiangkao at aol.com
Tue Nov 3 02:59:37 AEDT 2020


(will fold into the original patch.)

Signed-off-by: Gao Xiang <hsiangkao at aol.com>
---
 fuse/Makefile.am |  2 +-
 fuse/main.c      | 11 ++++++++++-
 fuse/open.c      | 22 ----------------------
 fuse/open.h      | 15 ---------------
 4 files changed, 11 insertions(+), 39 deletions(-)
 delete mode 100644 fuse/open.c
 delete mode 100644 fuse/open.h

diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index 6e639f33f664..5ff0b4d0e6ab 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -3,7 +3,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = erofsfuse
-erofsfuse_SOURCES = main.c dentry.c namei.c read.c open.c readir.c zmap.c
+erofsfuse_SOURCES = main.c dentry.c namei.c read.c readir.c zmap.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 3842fedce8c1..e423312d9e1a 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -14,7 +14,6 @@
 #include "erofs/print.h"
 #include "namei.h"
 #include "read.h"
-#include "open.h"
 #include "readir.h"
 #include "erofs/io.h"
 
@@ -125,6 +124,16 @@ void *erofs_init(struct fuse_conn_info *info)
 	return NULL;
 }
 
+int erofs_open(const char *path, struct fuse_file_info *fi)
+{
+	erofs_info("open path=%s", path);
+
+	if ((fi->flags & O_ACCMODE) != O_RDONLY)
+		return -EACCES;
+
+	return 0;
+}
+
 int erofs_getattr(const char *path, struct stat *stbuf)
 {
 	struct erofs_vnode v;
diff --git a/fuse/open.c b/fuse/open.c
deleted file mode 100644
index beb9a8615512..000000000000
--- a/fuse/open.c
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * erofs-utils/fuse/open.c
- *
- * Created by Li Guifu <blucerlee at gmail.com>
- */
-#include "open.h"
-#include <asm-generic/errno-base.h>
-#include <fuse.h>
-#include <fuse_opt.h>
-#include "erofs/print.h"
-
-int erofs_open(const char *path, struct fuse_file_info *fi)
-{
-	erofs_info("open path=%s", path);
-
-	if ((fi->flags & O_ACCMODE) != O_RDONLY)
-		return -EACCES;
-
-	return 0;
-}
-
diff --git a/fuse/open.h b/fuse/open.h
deleted file mode 100644
index dfc8b3cdd515..000000000000
--- a/fuse/open.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * erofs-utils/fuse/open.h
- *
- * Created by Li Guifu <blucerlee at gmail.com>
- */
-#ifndef __EROFS_OPEN_H
-#define __EROFS_OPEN_H
-
-#include <fuse.h>
-#include <fuse_opt.h>
-
-int erofs_open(const char *path, struct fuse_file_info *fi);
-
-#endif
-- 
2.24.0



More information about the Linux-erofs mailing list