History

fs: export mount options via statmount()

statmount() can export arbitrary strings, so utilize the __spare1 slot for a mnt_opts string pointer, and then support asking for and setting the mount options during statmount(). This calls into the helper for showing mount options, which already uses a seq_file, so fits in nicely with our existing mechanism for exporting strings via statmount().

Josef Bacik committed 2 years ago

Commit f9af5491 parent c72b6b72 files · +38 −2Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/mount.h+2−1
@@ -154,7 +154,7 @@ struct mount_attr { · 153 unmodified lines
154 */154 */
155struct statmount {155struct statmount {
156 __u32 size; /* Total size, including strings */156 __u32 size; /* Total size, including strings */
157 __u32 __spare1;157 __u32 mnt_opts; /* [str] Mount options of the mount */
158 __u64 mask; /* What results were written */158 __u64 mask; /* What results were written */
159 __u32 sb_dev_major; /* Device ID */159 __u32 sb_dev_major; /* Device ID */
160 __u32 sb_dev_minor;160 __u32 sb_dev_minor;
@@ -206,6 +206,7 @@ struct mnt_id_req { · 45 unmodified lines
206#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */206#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */
207#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */207#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */
208#define STATMOUNT_MNT_NS_ID 0x00000040U /* Want/got mnt_ns_id */208#define STATMOUNT_MNT_NS_ID 0x00000040U /* Want/got mnt_ns_id */
209#define STATMOUNT_MNT_OPTS 0x00000080U /* Want/got mnt_opts */
209 210
210/*211/*
211 * Special @mnt_id values that can be passed to listmount212 * Special @mnt_id values that can be passed to listmount