From: Catherine Hoang <catherine.hoang@oracle.com>
To: linux-xfs@vger.kernel.org
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH v2 1/2] fs: hoist get/set UUID ioctls
Date: Fri, 18 Nov 2022 13:14:07 -0800 [thread overview]
Message-ID: <20221118211408.72796-2-catherine.hoang@oracle.com> (raw)
In-Reply-To: <20221118211408.72796-1-catherine.hoang@oracle.com>
Hoist the EXT4_IOC_[GS]ETFSUUID ioctls so that they can be used by all
filesystems. This allows us to have a common interface for tools such as
coreutils.
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
---
fs/ext4/ext4.h | 13 ++-----------
include/uapi/linux/fs.h | 11 +++++++++++
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 8d5453852f98..b200302a3732 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -722,8 +722,8 @@ enum {
#define EXT4_IOC_GETSTATE _IOW('f', 41, __u32)
#define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap)
#define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
-#define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
-#define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
+#define EXT4_IOC_GETFSUUID FS_IOC_GETFSUUID
+#define EXT4_IOC_SETFSUUID FS_IOC_SETFSUUID
#define EXT4_IOC_SHUTDOWN _IOR ('X', 125, __u32)
@@ -753,15 +753,6 @@ enum {
EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | \
EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN)
-/*
- * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID
- */
-struct fsuuid {
- __u32 fsu_len;
- __u32 fsu_flags;
- __u8 fsu_uuid[];
-};
-
#if defined(__KERNEL__) && defined(CONFIG_COMPAT)
/*
* ioctl commands in 32 bit emulation
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index b7b56871029c..63b925444592 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -121,6 +121,15 @@ struct fsxattr {
unsigned char fsx_pad[8];
};
+/*
+ * Structure for FS_IOC_GETFSUUID/FS_IOC_SETFSUUID
+ */
+struct fsuuid {
+ __u32 fsu_len;
+ __u32 fsu_flags;
+ __u8 fsu_uuid[];
+};
+
/*
* Flags for the fsx_xflags field
*/
@@ -215,6 +224,8 @@ struct fsxattr {
#define FS_IOC_FSSETXATTR _IOW('X', 32, struct fsxattr)
#define FS_IOC_GETFSLABEL _IOR(0x94, 49, char[FSLABEL_MAX])
#define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX])
+#define FS_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
+#define FS_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
/*
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
--
2.25.1
next prev parent reply other threads:[~2022-11-18 21:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 21:14 [PATCH v2 0/2] porting the GETFSUUID ioctl to xfs Catherine Hoang
2022-11-18 21:14 ` Catherine Hoang [this message]
2022-11-21 21:14 ` [PATCH v2 1/2] fs: hoist get/set UUID ioctls Dave Chinner
2022-11-18 21:14 ` [PATCH v2 2/2] xfs: add FS_IOC_GETFSUUID ioctl Catherine Hoang
2022-11-21 18:05 ` Darrick J. Wong
2022-11-21 21:02 ` Dave Chinner
2022-11-21 22:18 ` Darrick J. Wong
2022-11-21 23:20 ` Dave Chinner
2022-11-21 21:15 ` [PATCH v2 0/2] porting the GETFSUUID ioctl to xfs Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221118211408.72796-2-catherine.hoang@oracle.com \
--to=catherine.hoang@oracle.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox