1# Copyright 2018 syzkaller project authors. All rights reserved. 2# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4include <uapi/linux/fs.h> 5include <uapi/linux/blktrace_api.h> 6include <uapi/linux/blkzoned.h> 7include <uapi/linux/pr.h> 8include <uapi/linux/hdreg.h> 9include <uapi/linux/blkpg.h> 10 11resource fd_block_trace[fd] 12resource fd_block[fd_block_trace] 13 14openat$nullb(fd const[AT_FDCWD], file ptr[in, string["/dev/nullb0"]], flags flags[open_flags], mode const[0]) fd_block 15openat$md(fd const[AT_FDCWD], file ptr[in, string["/dev/md0"]], flags flags[open_flags], mode const[0]) fd_block 16 17ioctl$BLKTRACESETUP(fd fd_block_trace, cmd const[BLKTRACESETUP], arg ptr[in, blk_user_trace_setup]) 18ioctl$BLKTRACESTART(fd fd_block_trace, cmd const[BLKTRACESTART], arg const[0]) 19ioctl$BLKTRACESTOP(fd fd_block_trace, cmd const[BLKTRACESTOP], arg const[0]) 20ioctl$BLKTRACETEARDOWN(fd fd_block_trace, cmd const[BLKTRACETEARDOWN], arg const[0]) 21 22ioctl$BLKFLSBUF(fd fd_block, cmd const[BLKFLSBUF], arg ptr[in, intptr]) 23ioctl$BLKROSET(fd fd_block, cmd const[BLKROSET], arg ptr[in, intptr]) 24ioctl$BLKDISCARD(fd fd_block, cmd const[BLKDISCARD], arg ptr[in, intptr]) 25ioctl$BLKSECDISCARD(fd fd_block, cmd const[BLKSECDISCARD], arg ptr[in, intptr]) 26ioctl$BLKZEROOUT(fd fd_block, cmd const[BLKZEROOUT], arg ptr[in, blk_zone_range]) 27ioctl$BLKREPORTZONE(fd fd_block, cmd const[BLKREPORTZONE], arg ptr[in, blk_zone_report]) 28ioctl$BLKRESETZONE(fd fd_block, cmd const[BLKRESETZONE], arg ptr[in, blk_zone_range]) 29ioctl$BLKRAGET(fd fd_block, cmd const[BLKRAGET], arg ptr[out, intptr]) 30ioctl$BLKROGET(fd fd_block, cmd const[BLKROGET], arg ptr[out, intptr]) 31ioctl$BLKBSZGET(fd fd_block, cmd const[BLKBSZGET], arg ptr[out, intptr]) 32ioctl$BLKPBSZGET(fd fd_block, cmd const[BLKPBSZGET], arg ptr[out, intptr]) 33ioctl$BLKIOMIN(fd fd_block, cmd const[BLKIOMIN], arg ptr[out, intptr]) 34ioctl$BLKIOOPT(fd fd_block, cmd const[BLKIOOPT], arg ptr[out, intptr]) 35ioctl$BLKALIGNOFF(fd fd_block, cmd const[BLKALIGNOFF], arg ptr[out, intptr]) 36ioctl$BLKSECTGET(fd fd_block, cmd const[BLKSECTGET], arg ptr[out, intptr]) 37ioctl$BLKROTATIONAL(fd fd_block, cmd const[BLKROTATIONAL], arg ptr[out, intptr]) 38ioctl$BLKFRASET(fd fd_block, cmd const[BLKFRASET], arg ptr[in, intptr]) 39ioctl$BLKBSZSET(fd fd_block, cmd const[BLKBSZSET], arg ptr[in, intptr]) 40ioctl$BLKPG(fd fd_block, cmd const[BLKPG], arg ptr[in, blkpg_ioctl_arg]) 41ioctl$BLKRRPART(fd fd_block, cmd const[BLKRRPART], arg const[0]) 42ioctl$BLKGETSIZE(fd fd_block, cmd const[BLKGETSIZE], arg ptr[out, intptr]) 43ioctl$BLKGETSIZE64(fd fd_block, cmd const[BLKGETSIZE64], arg ptr[out, int64]) 44 45ioctl$HDIO_GETGEO(fd fd_block, cmd const[HDIO_GETGEO], arg ptr[out, hd_geometry]) 46 47ioctl$IOC_PR_REGISTER(fd fd_block, cmd const[IOC_PR_REGISTER], arg ptr[in, pr_registration]) 48ioctl$IOC_PR_RESERVE(fd fd_block, cmd const[IOC_PR_RESERVE], arg ptr[in, pr_reservation]) 49ioctl$IOC_PR_RELEASE(fd fd_block, cmd const[IOC_PR_RELEASE], arg ptr[in, pr_reservation]) 50ioctl$IOC_PR_PREEMPT(fd fd_block, cmd const[IOC_PR_PREEMPT], arg ptr[in, pr_preempt]) 51ioctl$IOC_PR_PREEMPT_ABORT(fd fd_block, cmd const[IOC_PR_PREEMPT_ABORT], arg ptr[in, pr_preempt]) 52ioctl$IOC_PR_CLEAR(fd fd_block, cmd const[IOC_PR_CLEAR], arg ptr[in, pr_clear]) 53 54blk_zone_report { 55 sector int64 56 nr_zones len[zones, int32] 57 reserved const[0, int32] 58 zones array[blk_zone] 59} [packed] 60 61blk_zone { 62 start int64 63 len int64 64 wp int64 65 type int8 66 cond int8 67 non_seq int8 68 reset int8 69 reserved array[const[0, int8], 36] 70} 71 72blk_zone_range { 73 sector int64 74 nr_sectors int64 75} 76 77hd_geometry { 78 heads int8 79 sectors int8 80 cylinders int16 81 start intptr 82} 83 84blkpg_ioctl_arg { 85 op int32 86 flags int32 87 datalen bytesize[data, int32] 88 data ptr[in, array[int8]] 89} 90 91blk_user_trace_setup { 92 name array[const[0, int8], BLKTRACE_BDEV_SIZE] 93 act_mask int16 94 buf_size int32 95 buf_nr int32 96 start_lba int64 97 end_lba int64 98 pid pid 99} 100 101pr_registration { 102 old_key int64 103 new_key int64 104 flags bool32 105 pad const[0, int32] 106} 107 108pr_reservation { 109 key int64 110 type int32 111 flags bool32 112} 113 114pr_preempt { 115 old_key int64 116 new_key int64 117 type int32 118 flags int32 119} 120 121pr_clear { 122 key int64 123 flags const[0, int32] 124 pad const[0, int32] 125} 126