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
154154 */
155155 struct statmount {
156156 __u32 size; /* Total size, including strings */
157− __u32 __spare1;
157+ __u32 mnt_opts; /* [str] Mount options of the mount */
158158 __u64 mask; /* What results were written */
159159 __u32 sb_dev_major; /* Device ID */
160160 __u32 sb_dev_minor;
@@ -206,6 +206,7 @@ struct mnt_id_req { · 45 unmodified lines
206206 #define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */
207207 #define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */
208208 #define STATMOUNT_MNT_NS_ID 0x00000040U /* Want/got mnt_ns_id */
209+#define STATMOUNT_MNT_OPTS 0x00000080U /* Want/got mnt_opts */
209210
210211 /*
211212 * Special @mnt_id values that can be passed to listmount