Thread (29 messages) 29 messages, 2 authors, 2025-09-19
STALE292d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 02/16] blktrace: add definitions for blk_user_trace_setup2

From: Johannes Thumshirn <hidden>
Date: 2025-09-09 11:06:33
Also in: linux-block, lkml
Subsystem: block layer, filesystems (vfs and infrastructure), the rest · Maintainers: Jens Axboe, Alexander Viro, Christian Brauner, Linus Torvalds

Add definitions for a version 2 of the blk_user_trace_setup ioctl. This
new will enable a different struct layout of the binary data passed to
user-space when using a new version of the blktrace utility requesting the
new struct layout.

Signed-off-by: Johannes Thumshirn <redacted>
---
 include/uapi/linux/blktrace_api.h | 14 ++++++++++++++
 include/uapi/linux/fs.h           |  1 +
 2 files changed, 15 insertions(+)
diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
index 1bfb635e309b..ba61374f90d8 100644
--- a/include/uapi/linux/blktrace_api.h
+++ b/include/uapi/linux/blktrace_api.h
@@ -143,4 +143,18 @@ struct blk_user_trace_setup {
 	__u32 pid;
 };
 
+/*
+ * User setup structure passed with BLKTRACESETUP2
+ */
+struct blk_user_trace_setup2 {
+        char name[32];                  /* output */
+        __u64 act_mask;                 /* input */
+        __u32 buf_size;                 /* input */
+        __u32 buf_nr;                   /* input */
+        __u64 start_lba;
+        __u64 end_lba;
+        __u32 pid;
+        __u32 reserved;                 /* for futute use */
+};
+
 #endif /* _UAPIBLKTRACE_H */
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index 0bd678a4a10e..a85d0b52a3f6 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -300,6 +300,7 @@ struct file_attr {
 #define BLKGETDISKSEQ _IOR(0x12,128,__u64)
 /* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
 /* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */
+#define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2)
 
 #define BMAP_IOCTL 1		/* obsolete - kept for compatibility */
 #define FIBMAP	   _IO(0x00,1)	/* bmap access */
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help