[PATCH v2] fuse: rename some files and clean up Makefile
From: Tiezhu Yang
Date: Sat Nov 27 2021 - 05:15:45 EST
No need to generate virtio_fs.o first and then link to virtiofs.o, just
rename virtio_fs.c to virtiofs.c and remove "virtiofs-y := virtio_fs.o"
in Makefile, also update MAINTAINERS. Additionally, rename the private
header file fuse_i.h to fuse.h, like ext4.h in fs/ext4, xfs.h in fs/xfs
and f2fs.h in fs/f2fs.
Without this patch:
CC [M] fs/fuse/virtio_fs.o
LD [M] fs/fuse/virtiofs.o
MODPOST modules-only.symvers
GEN Module.symvers
CC [M] fs/fuse/virtiofs.mod.o
LD [M] fs/fuse/virtiofs.ko
With this patch:
CC [M] fs/fuse/virtiofs.o
MODPOST modules-only.symvers
GEN Module.symvers
CC [M] fs/fuse/virtiofs.mod.o
LD [M] fs/fuse/virtiofs.ko
Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
v2: rename fuse_i.h to fuse.h
MAINTAINERS | 2 +-
fs/fuse/Makefile | 2 --
fs/fuse/acl.c | 2 +-
fs/fuse/control.c | 2 +-
fs/fuse/cuse.c | 2 +-
fs/fuse/dax.c | 2 +-
fs/fuse/dev.c | 2 +-
fs/fuse/dir.c | 2 +-
fs/fuse/file.c | 2 +-
fs/fuse/{fuse_i.h => fuse.h} | 0
fs/fuse/inode.c | 2 +-
fs/fuse/ioctl.c | 2 +-
fs/fuse/readdir.c | 2 +-
fs/fuse/{virtio_fs.c => virtiofs.c} | 2 +-
fs/fuse/xattr.c | 2 +-
15 files changed, 13 insertions(+), 15 deletions(-)
rename fs/fuse/{fuse_i.h => fuse.h} (100%)
rename fs/fuse/{virtio_fs.c => virtiofs.c} (99%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7a2345c..8c2ad7b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20152,7 +20152,7 @@ L: linux-fsdevel@xxxxxxxxxxxxxxx
S: Supported
W: https://virtio-fs.gitlab.io/
F: Documentation/filesystems/virtiofs.rst
-F: fs/fuse/virtio_fs.c
+F: fs/fuse/virtiofs.c
F: include/uapi/linux/virtio_fs.h
VIRTIO GPIO DRIVER
diff --git a/fs/fuse/Makefile b/fs/fuse/Makefile
index 0c48b35..5f10fe6 100644
--- a/fs/fuse/Makefile
+++ b/fs/fuse/Makefile
@@ -9,5 +9,3 @@ obj-$(CONFIG_VIRTIO_FS) += virtiofs.o
fuse-y := dev.o dir.o file.o inode.o control.o xattr.o acl.o readdir.o ioctl.o
fuse-$(CONFIG_FUSE_DAX) += dax.o
-
-virtiofs-y := virtio_fs.o
diff --git a/fs/fuse/acl.c b/fs/fuse/acl.c
index 337cb29..2292e44 100644
--- a/fs/fuse/acl.c
+++ b/fs/fuse/acl.c
@@ -6,7 +6,7 @@
* See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/posix_acl.h>
#include <linux/posix_acl_xattr.h>
diff --git a/fs/fuse/control.c b/fs/fuse/control.c
index 000d2e5..dc9095f 100644
--- a/fs/fuse/control.c
+++ b/fs/fuse/control.c
@@ -6,7 +6,7 @@
See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/init.h>
#include <linux/module.h>
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index c7d882a..bc115e8 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -51,7 +51,7 @@
#include <linux/uio.h>
#include <linux/user_namespace.h>
-#include "fuse_i.h"
+#include "fuse.h"
#define CUSE_CONNTBL_LEN 64
diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index 713818d..25dae57 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -4,7 +4,7 @@
* Copyright (C) 2020 Red Hat, Inc.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/delay.h>
#include <linux/dax.h>
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index cd54a52..e133c1c 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -6,7 +6,7 @@
See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/init.h>
#include <linux/module.h>
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 656e921..58b8af6 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -6,7 +6,7 @@
See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/pagemap.h>
#include <linux/file.h>
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 9d6c5f6..f5e10ab 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -6,7 +6,7 @@
See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/pagemap.h>
#include <linux/slab.h>
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse.h
similarity index 100%
rename from fs/fuse/fuse_i.h
rename to fs/fuse/fuse.h
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 63ab454..0ffd0fe 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -6,7 +6,7 @@
See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/pagemap.h>
#include <linux/slab.h>
diff --git a/fs/fuse/ioctl.c b/fs/fuse/ioctl.c
index fbc09da..1004d7a 100644
--- a/fs/fuse/ioctl.c
+++ b/fs/fuse/ioctl.c
@@ -3,7 +3,7 @@
* Copyright (C) 2017 Red Hat, Inc.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/uio.h>
#include <linux/compat.h>
diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c
index b4e5657..d83a7a3 100644
--- a/fs/fuse/readdir.c
+++ b/fs/fuse/readdir.c
@@ -6,8 +6,8 @@
See the file COPYING.
*/
+#include "fuse.h"
-#include "fuse_i.h"
#include <linux/iversion.h>
#include <linux/posix_acl.h>
#include <linux/pagemap.h>
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtiofs.c
similarity index 99%
rename from fs/fuse/virtio_fs.c
rename to fs/fuse/virtiofs.c
index 4cfa4bc..cc3a8ae 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtiofs.c
@@ -16,7 +16,7 @@
#include <linux/fs_parser.h>
#include <linux/highmem.h>
#include <linux/uio.h>
-#include "fuse_i.h"
+#include "fuse.h"
/* Used to help calculate the FUSE connection's max_pages limit for a request's
* size. Parts of the struct fuse_req are sliced into scattergather lists in
diff --git a/fs/fuse/xattr.c b/fs/fuse/xattr.c
index 0d3e717..641bf3b 100644
--- a/fs/fuse/xattr.c
+++ b/fs/fuse/xattr.c
@@ -6,7 +6,7 @@
* See the file COPYING.
*/
-#include "fuse_i.h"
+#include "fuse.h"
#include <linux/xattr.h>
#include <linux/posix_acl_xattr.h>
--
2.1.0