Skip to content

Commit 4a4083a

Browse files
committed
tools headers: Sync uapi/linux/fs.h with the kernel source
To pick up the changes in this cset: 76fdb7e uapi: export PROCFS_ROOT_INO ca115d7 tree-wide: s/struct fileattr/struct file_kattr/g be7efb2 fs: introduce file_getattr and file_setattr syscalls 9eb22f7 fs: add ioctl to query metadata and protection info capabilities This addresses these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h Please see tools/include/uapi/README for further details. Cc: Christian Brauner <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent b18aabe commit 4a4083a

File tree

1 file changed

+88
-0
lines changed
  • tools/perf/trace/beauty/include/uapi/linux

1 file changed

+88
-0
lines changed

tools/perf/trace/beauty/include/uapi/linux/fs.h

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@
6060
#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
6161
#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */
6262

63+
/*
64+
* The root inode of procfs is guaranteed to always have the same inode number.
65+
* For programs that make heavy use of procfs, verifying that the root is a
66+
* real procfs root and using openat2(RESOLVE_{NO_{XDEV,MAGICLINKS},BENEATH})
67+
* will allow you to make sure you are never tricked into operating on the
68+
* wrong procfs file.
69+
*/
70+
enum procfs_ino {
71+
PROCFS_ROOT_INO = 1,
72+
};
73+
6374
struct file_clone_range {
6475
__s64 src_fd;
6576
__u64 src_offset;
@@ -91,6 +102,63 @@ struct fs_sysfs_path {
91102
__u8 name[128];
92103
};
93104

105+
/* Protection info capability flags */
106+
#define LBMD_PI_CAP_INTEGRITY (1 << 0)
107+
#define LBMD_PI_CAP_REFTAG (1 << 1)
108+
109+
/* Checksum types for Protection Information */
110+
#define LBMD_PI_CSUM_NONE 0
111+
#define LBMD_PI_CSUM_IP 1
112+
#define LBMD_PI_CSUM_CRC16_T10DIF 2
113+
#define LBMD_PI_CSUM_CRC64_NVME 4
114+
115+
/* sizeof first published struct */
116+
#define LBMD_SIZE_VER0 16
117+
118+
/*
119+
* Logical block metadata capability descriptor
120+
* If the device does not support metadata, all the fields will be zero.
121+
* Applications must check lbmd_flags to determine whether metadata is
122+
* supported or not.
123+
*/
124+
struct logical_block_metadata_cap {
125+
/* Bitmask of logical block metadata capability flags */
126+
__u32 lbmd_flags;
127+
/*
128+
* The amount of data described by each unit of logical block
129+
* metadata
130+
*/
131+
__u16 lbmd_interval;
132+
/*
133+
* Size in bytes of the logical block metadata associated with each
134+
* interval
135+
*/
136+
__u8 lbmd_size;
137+
/*
138+
* Size in bytes of the opaque block tag associated with each
139+
* interval
140+
*/
141+
__u8 lbmd_opaque_size;
142+
/*
143+
* Offset in bytes of the opaque block tag within the logical block
144+
* metadata
145+
*/
146+
__u8 lbmd_opaque_offset;
147+
/* Size in bytes of the T10 PI tuple associated with each interval */
148+
__u8 lbmd_pi_size;
149+
/* Offset in bytes of T10 PI tuple within the logical block metadata */
150+
__u8 lbmd_pi_offset;
151+
/* T10 PI guard tag type */
152+
__u8 lbmd_guard_tag_type;
153+
/* Size in bytes of the T10 PI application tag */
154+
__u8 lbmd_app_tag_size;
155+
/* Size in bytes of the T10 PI reference tag */
156+
__u8 lbmd_ref_tag_size;
157+
/* Size in bytes of the T10 PI storage tag */
158+
__u8 lbmd_storage_tag_size;
159+
__u8 pad;
160+
};
161+
94162
/* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
95163
#define FILE_DEDUPE_RANGE_SAME 0
96164
#define FILE_DEDUPE_RANGE_DIFFERS 1
@@ -148,6 +216,24 @@ struct fsxattr {
148216
unsigned char fsx_pad[8];
149217
};
150218

219+
/*
220+
* Variable size structure for file_[sg]et_attr().
221+
*
222+
* Note. This is alternative to the structure 'struct file_kattr'/'struct fsxattr'.
223+
* As this structure is passed to/from userspace with its size, this can
224+
* be versioned based on the size.
225+
*/
226+
struct file_attr {
227+
__u64 fa_xflags; /* xflags field value (get/set) */
228+
__u32 fa_extsize; /* extsize field value (get/set)*/
229+
__u32 fa_nextents; /* nextents field value (get) */
230+
__u32 fa_projid; /* project identifier (get/set) */
231+
__u32 fa_cowextsize; /* CoW extsize field value (get/set) */
232+
};
233+
234+
#define FILE_ATTR_SIZE_VER0 24
235+
#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER0
236+
151237
/*
152238
* Flags for the fsx_xflags field
153239
*/
@@ -247,6 +333,8 @@ struct fsxattr {
247333
* also /sys/kernel/debug/ for filesystems with debugfs exports
248334
*/
249335
#define FS_IOC_GETFSSYSFSPATH _IOR(0x15, 1, struct fs_sysfs_path)
336+
/* Get logical block metadata capability details */
337+
#define FS_IOC_GETLBMD_CAP _IOWR(0x15, 2, struct logical_block_metadata_cap)
250338

251339
/*
252340
* Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)

0 commit comments

Comments
 (0)