2021-11-27 10:15:43

by Tiezhu Yang

[permalink] [raw]
Subject: [PATCH v2] fuse: rename some files and clean up Makefile

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 <[email protected]>
---

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: [email protected]
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



2021-11-29 09:40:41

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH v2] fuse: rename some files and clean up Makefile

On Sat, 27 Nov 2021 at 11:14, Tiezhu Yang <[email protected]> wrote:
>
> 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.

Sorry, no. This will make backport of bugfixes harder for no good reason.

Thanks,
Miklos

2021-11-29 10:22:06

by Stefan Hajnoczi

[permalink] [raw]
Subject: Re: [PATCH v2] fuse: rename some files and clean up Makefile

On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote:
> 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.

There are two separate changes in this patch (virtio_fs.c -> virtiofs.c
and fuse_i.h -> fuse.h). A patch series with two patches would be easier
to review and cleaner to backport.

I'm happy with renaming virtio_fs.c to virtiofs.c:

Reviewed-by: Stefan Hajnoczi <[email protected]>


Attachments:
(No filename) (666.00 B)
signature.asc (488.00 B)
Download all attachments

2021-11-29 13:29:25

by Tiezhu Yang

[permalink] [raw]
Subject: Re: [PATCH v2] fuse: rename some files and clean up Makefile

On 11/29/2021 06:19 PM, Stefan Hajnoczi wrote:
> On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote:
>> 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.
>
> There are two separate changes in this patch (virtio_fs.c -> virtiofs.c
> and fuse_i.h -> fuse.h). A patch series with two patches would be easier
> to review and cleaner to backport.
>
> I'm happy with renaming virtio_fs.c to virtiofs.c:
>
> Reviewed-by: Stefan Hajnoczi <[email protected]>
>

Hi Stefan and Miklos,

Thanks for your reply, what should I do now?

(1) split this patch into two separate patches to send v3;
(2) just ignore this patch because
"This will make backport of bugfixes harder for no good reason."
said by Miklos.

Thanks,
Tiezhu


2021-11-29 13:35:53

by Vivek Goyal

[permalink] [raw]
Subject: Re: [PATCH v2] fuse: rename some files and clean up Makefile

On Mon, Nov 29, 2021 at 09:27:17PM +0800, Tiezhu Yang wrote:
> On 11/29/2021 06:19 PM, Stefan Hajnoczi wrote:
> > On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote:
> > > 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.
> >
> > There are two separate changes in this patch (virtio_fs.c -> virtiofs.c
> > and fuse_i.h -> fuse.h). A patch series with two patches would be easier
> > to review and cleaner to backport.
> >
> > I'm happy with renaming virtio_fs.c to virtiofs.c:
> >
> > Reviewed-by: Stefan Hajnoczi <[email protected]>
> >
>
> Hi Stefan and Miklos,
>
> Thanks for your reply, what should I do now?
>
> (1) split this patch into two separate patches to send v3;
> (2) just ignore this patch because
> "This will make backport of bugfixes harder for no good reason."
> said by Miklos.

I agree with Miklos that there does not seem to be a very strong reason
to rename. It probably falls in the category of nice to have cleanup. But
it will also make backports harder. So I also like the idea of not making
this change.

Vivek


2021-12-01 10:23:59

by Stefan Hajnoczi

[permalink] [raw]
Subject: Re: [PATCH v2] fuse: rename some files and clean up Makefile

On Mon, Nov 29, 2021 at 09:27:17PM +0800, Tiezhu Yang wrote:
> On 11/29/2021 06:19 PM, Stefan Hajnoczi wrote:
> > On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote:
> > > 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.
> >
> > There are two separate changes in this patch (virtio_fs.c -> virtiofs.c
> > and fuse_i.h -> fuse.h). A patch series with two patches would be easier
> > to review and cleaner to backport.
> >
> > I'm happy with renaming virtio_fs.c to virtiofs.c:
> >
> > Reviewed-by: Stefan Hajnoczi <[email protected]>
> >
>
> Hi Stefan and Miklos,
>
> Thanks for your reply, what should I do now?
>
> (1) split this patch into two separate patches to send v3;
> (2) just ignore this patch because
> "This will make backport of bugfixes harder for no good reason."
> said by Miklos.

Miklos' point makes sense to me and he is the FUSE maintainer.

Stefan


Attachments:
(No filename) (1.14 kB)
signature.asc (488.00 B)
Download all attachments