Skip to content

Commit 1f8c43b

Browse files
committed
tools include UAPI: Sync linux/mount.h copy with the kernel sources
To pick the changes from: 35e27a5 ("fs: keep struct mnt_id_req extensible") b4c2bea ("add listmount(2) syscall") 46eae99 ("add statmount(2) syscall") That doesn't change anything in tools this time as nothing that is harvested by the beauty scripts got changed: $ ls -1 tools/perf/trace/beauty/*mount*sh tools/perf/trace/beauty/fsmount.sh tools/perf/trace/beauty/mount_flags.sh tools/perf/trace/beauty/move_mount_flags.sh $ This addresses this perf build warning. Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/mount.h include/uapi/linux/mount.h Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Miklos Szeredi <mszeredi@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/lkml/ZbkMiB7ZcOsLP2V5@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 7814fe2 commit 1f8c43b

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

tools/include/uapi/linux/mount.h

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,74 @@ struct mount_attr {
138138
/* List of all mount_attr versions. */
139139
#define MOUNT_ATTR_SIZE_VER0 32 /* sizeof first published struct */
140140

141+
142+
/*
143+
* Structure for getting mount/superblock/filesystem info with statmount(2).
144+
*
145+
* The interface is similar to statx(2): individual fields or groups can be
146+
* selected with the @mask argument of statmount(). Kernel will set the @mask
147+
* field according to the supported fields.
148+
*
149+
* If string fields are selected, then the caller needs to pass a buffer that
150+
* has space after the fixed part of the structure. Nul terminated strings are
151+
* copied there and offsets relative to @str are stored in the relevant fields.
152+
* If the buffer is too small, then EOVERFLOW is returned. The actually used
153+
* size is returned in @size.
154+
*/
155+
struct statmount {
156+
__u32 size; /* Total size, including strings */
157+
__u32 __spare1;
158+
__u64 mask; /* What results were written */
159+
__u32 sb_dev_major; /* Device ID */
160+
__u32 sb_dev_minor;
161+
__u64 sb_magic; /* ..._SUPER_MAGIC */
162+
__u32 sb_flags; /* SB_{RDONLY,SYNCHRONOUS,DIRSYNC,LAZYTIME} */
163+
__u32 fs_type; /* [str] Filesystem type */
164+
__u64 mnt_id; /* Unique ID of mount */
165+
__u64 mnt_parent_id; /* Unique ID of parent (for root == mnt_id) */
166+
__u32 mnt_id_old; /* Reused IDs used in proc/.../mountinfo */
167+
__u32 mnt_parent_id_old;
168+
__u64 mnt_attr; /* MOUNT_ATTR_... */
169+
__u64 mnt_propagation; /* MS_{SHARED,SLAVE,PRIVATE,UNBINDABLE} */
170+
__u64 mnt_peer_group; /* ID of shared peer group */
171+
__u64 mnt_master; /* Mount receives propagation from this ID */
172+
__u64 propagate_from; /* Propagation from in current namespace */
173+
__u32 mnt_root; /* [str] Root of mount relative to root of fs */
174+
__u32 mnt_point; /* [str] Mountpoint relative to current root */
175+
__u64 __spare2[50];
176+
char str[]; /* Variable size part containing strings */
177+
};
178+
179+
/*
180+
* Structure for passing mount ID and miscellaneous parameters to statmount(2)
181+
* and listmount(2).
182+
*
183+
* For statmount(2) @param represents the request mask.
184+
* For listmount(2) @param represents the last listed mount id (or zero).
185+
*/
186+
struct mnt_id_req {
187+
__u32 size;
188+
__u32 spare;
189+
__u64 mnt_id;
190+
__u64 param;
191+
};
192+
193+
/* List of all mnt_id_req versions. */
194+
#define MNT_ID_REQ_SIZE_VER0 24 /* sizeof first published struct */
195+
196+
/*
197+
* @mask bits for statmount(2)
198+
*/
199+
#define STATMOUNT_SB_BASIC 0x00000001U /* Want/got sb_... */
200+
#define STATMOUNT_MNT_BASIC 0x00000002U /* Want/got mnt_... */
201+
#define STATMOUNT_PROPAGATE_FROM 0x00000004U /* Want/got propagate_from */
202+
#define STATMOUNT_MNT_ROOT 0x00000008U /* Want/got mnt_root */
203+
#define STATMOUNT_MNT_POINT 0x00000010U /* Want/got mnt_point */
204+
#define STATMOUNT_FS_TYPE 0x00000020U /* Want/got fs_type */
205+
206+
/*
207+
* Special @mnt_id values that can be passed to listmount
208+
*/
209+
#define LSMT_ROOT 0xffffffffffffffff /* root mount */
210+
141211
#endif /* _UAPI_LINUX_MOUNT_H */

0 commit comments

Comments
 (0)