Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

blktrace: add definitions for blk_user_trace_setup2

Add definitions for a version 2 of the blk_user_trace_setup ioctl. This
new ioctl 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.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Johannes Thumshirn and committed by
Jens Axboe
0d8627cc 42da88a7

+20
+16
include/uapi/linux/blktrace_api.h
··· 129 129 }; 130 130 131 131 #define BLKTRACE_BDEV_SIZE 32 132 + #define BLKTRACE_BDEV_SIZE2 64 132 133 133 134 /* 134 135 * User setup structure passed with BLKTRACESETUP ··· 142 141 __u64 start_lba; 143 142 __u64 end_lba; 144 143 __u32 pid; 144 + }; 145 + 146 + /* 147 + * User setup structure passed with BLKTRACESETUP2 148 + */ 149 + struct blk_user_trace_setup2 { 150 + char name[BLKTRACE_BDEV_SIZE2]; /* output */ 151 + __u64 act_mask; /* input */ 152 + __u32 buf_size; /* input */ 153 + __u32 buf_nr; /* input */ 154 + __u64 start_lba; 155 + __u64 end_lba; 156 + __u32 pid; 157 + __u32 flags; /* currently unused */ 158 + __u64 reserved[11]; 145 159 }; 146 160 147 161 #endif /* _UAPIBLKTRACE_H */
+1
include/uapi/linux/fs.h
··· 300 300 #define BLKGETDISKSEQ _IOR(0x12,128,__u64) 301 301 /* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */ 302 302 /* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */ 303 + #define BLKTRACESETUP2 _IOWR(0x12, 142, struct blk_user_trace_setup2) 303 304 304 305 #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ 305 306 #define FIBMAP _IO(0x00,1) /* bmap access */
+3
kernel/trace/blktrace.c
··· 1601 1601 return 1; 1602 1602 } 1603 1603 1604 + BUILD_BUG_ON(__alignof__(struct blk_user_trace_setup2) % 1605 + __alignof__(long)); 1606 + 1604 1607 return 0; 1605 1608 } 1606 1609