[Devel] [PATCH 1/2] fs/fuse: move FUSE_SUPER_MAGIC to magic.h

Pavel Butsykin pbutsykin at virtuozzo.com
Thu May 17 12:40:08 MSK 2018


Let's define it only once.

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 drivers/block/ploop/dev.c     | 1 -
 drivers/block/ploop/io_kaio.c | 3 ---
 fs/fuse/inode.c               | 2 --
 include/uapi/linux/magic.h    | 1 +
 4 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 533ddc965af2..0e72656ec8f9 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -3880,7 +3880,6 @@ static int ploop_truncate(struct ploop_device * plo, unsigned long arg)
 	return err;
 }
 
-#define FUSE_SUPER_MAGIC 0x65735546
 #define IS_PSTORAGE(sb) (sb->s_magic == FUSE_SUPER_MAGIC && \
 			 (!strcmp(sb->s_subtype, "pstorage") || \
 			  !strcmp(sb->s_subtype, "vstorage")))
diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index c7312c54595e..48baa447ef91 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -17,9 +17,6 @@
 
 #include <linux/ploop/ploop.h>
 
-/* from fs/inode/fuse.c */
-#define FUSE_SUPER_MAGIC 0x65735546
-
 #define KAIO_PREALLOC (128 * 1024 * 1024) /* 128 MB */
 
 #define KAIO_MAX_PAGES_PER_REQ 32	  /* 128 KB */
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f89bda719c71..ed5451a1eb7a 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -51,8 +51,6 @@ MODULE_PARM_DESC(max_user_congthresh,
  "Global limit for the maximum congestion threshold an "
  "unprivileged user can set");
 
-#define FUSE_SUPER_MAGIC 0x65735546
-
 #define FUSE_DEFAULT_BLKSIZE 512
 
 /** Maximum number of outstanding background requests */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 599c96d6d03d..e0698ec4536b 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -32,6 +32,7 @@
 #define EFIVARFS_MAGIC		0xde5e81e4
 #define HOSTFS_SUPER_MAGIC	0x00c0ffee
 #define OVERLAYFS_SUPER_MAGIC	0x794c7630
+#define FUSE_SUPER_MAGIC	0x65735546
 
 #define MINIX_SUPER_MAGIC	0x137F		/* minix v1 fs, 14 char names */
 #define MINIX_SUPER_MAGIC2	0x138F		/* minix v1 fs, 30 char names */
-- 
2.15.1



More information about the Devel mailing list