diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-06 21:56:19 -0500 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-02-12 13:13:59 +0100 |
commit | ae8c511757304e0c393661b5ed2ad7073e2a351d (patch) | |
tree | 06a6782f360ac08e5febc40130979f0a7356fcab /include/uapi/linux/fs.h | |
parent | e2f7dd6e55d2f39734abcebd0cf673700e206197 (diff) | |
download | linux-ae8c511757304e0c393661b5ed2ad7073e2a351d.tar.gz linux-ae8c511757304e0c393661b5ed2ad7073e2a351d.tar.bz2 linux-ae8c511757304e0c393661b5ed2ad7073e2a351d.zip |
fs: add FS_IOC_GETFSSYSFSPATH
Add a new ioctl for getting the sysfs name of a filesystem - the path
under /sys/fs.
This is going to let us standardize exporting data from sysfs across
filesystems, e.g. time stats.
The returned path will always be of the form "$FSTYP/$SYSFS_IDENTIFIER",
where the sysfs identifier may be a UUID (for bcachefs) or a device name
(xfs).
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Link: https://lore.kernel.org/r/20240207025624.1019754-6-kent.overstreet@linux.dev
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/uapi/linux/fs.h')
-rw-r--r-- | include/uapi/linux/fs.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 40880ce99d02..dcd6c8c7d2c7 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -77,6 +77,11 @@ struct fsuuid2 { __u8 uuid[16]; }; +struct fs_sysfs_path { + __u8 len; + __u8 name[128]; +}; + /* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */ #define FILE_DEDUPE_RANGE_SAME 0 #define FILE_DEDUPE_RANGE_DIFFERS 1 @@ -230,6 +235,11 @@ struct fsxattr { #define FS_IOC_SETFSLABEL _IOW(0x94, 50, char[FSLABEL_MAX]) /* Returns the external filesystem UUID, the same one blkid returns */ #define FS_IOC_GETFSUUID _IOR(0x15, 0, struct fsuuid2) +/* + * Returns the path component under /sys/fs/ that refers to this filesystem; + * also /sys/kernel/debug/ for filesystems with debugfs exports + */ +#define FS_IOC_GETFSSYSFSPATH _IOR(0x15, 1, struct fs_sysfs_path) /* * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) |