Dash:
[t2-trunk.git] / architecture / riscv / package / linux-header / blkzoned.patch
blobf450cc5bd31f27749d511c0d23922f3fdcb522f8
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/*/linux-header/blkzoned.patch
5 # Copyright (C) 2021 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- linux-5.1/include/uapi/linux/blkzoned.h.vanilla 2021-08-20 18:28:29.598771981 +0200
18 +++ linux-5.1/include/uapi/linux/blkzoned.h 2021-08-20 18:27:40.197773951 +0200
19 @@ -74,6 +74,15 @@
22 /**
23 + * enum blk_zone_report_flags - Feature flags of reported zone descriptors.
24 + *
25 + * @BLK_ZONE_REP_CAPACITY: Zone descriptor has capacity field.
26 + */
27 +enum blk_zone_report_flags {
28 + BLK_ZONE_REP_CAPACITY = (1 << 0),
29 +};
31 +/**
32 * struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl.
34 * @start: Zone start in 512 B sector units
35 @@ -84,12 +93,15 @@
36 * @non_seq: Flag indicating that the zone is using non-sequential resources
37 * (for host-aware zoned block devices only).
38 * @reset: Flag indicating that a zone reset is recommended.
39 - * @reserved: Padding to 64 B to match the ZBC/ZAC defined zone descriptor size.
40 + * @resv: Padding for 8B alignment.
41 + * @capacity: Zone usable capacity in 512 B sector units
42 + * @reserved: Padding to 64 B to match the ZBC, ZAC and ZNS defined zone
43 + * descriptor size.
45 - * start, len and wp use the regular 512 B sector unit, regardless of the
46 - * device logical block size. The overall structure size is 64 B to match the
47 - * ZBC/ZAC defined zone descriptor and allow support for future additional
48 - * zone information.
49 + * start, len, capacity and wp use the regular 512 B sector unit, regardless
50 + * of the device logical block size. The overall structure size is 64 B to
51 + * match the ZBC, ZAC and ZNS defined zone descriptor and allow support for
52 + * future additional zone information.
54 struct blk_zone {
55 __u64 start; /* Zone start sector */
56 @@ -99,7 +111,9 @@
57 __u8 cond; /* Zone condition */
58 __u8 non_seq; /* Non-sequential write resources active */
59 __u8 reset; /* Reset write pointer recommended */
60 - __u8 reserved[36];
61 + __u8 resv[4];
62 + __u64 capacity; /* Zone capacity in number of sectors */
63 + __u8 reserved[24];
66 /**
67 @@ -107,7 +121,7 @@
69 * @sector: starting sector of report
70 * @nr_zones: IN maximum / OUT actual
71 - * @reserved: padding to 16 byte alignment
72 + * @flags: one or more flags as defined by enum blk_zone_report_flags.
73 * @zones: Space to hold @nr_zones @zones entries on reply.
75 * The array of at most @nr_zones must follow this structure in memory.
76 @@ -115,14 +129,16 @@
77 struct blk_zone_report {
78 __u64 sector;
79 __u32 nr_zones;
80 - __u8 reserved[4];
81 + __u32 flags;
82 struct blk_zone zones[0];
85 /**
86 - * struct blk_zone_range - BLKRESETZONE ioctl request
87 - * @sector: starting sector of the first zone to issue reset write pointer
88 - * @nr_sectors: Total number of sectors of 1 or more zones to reset
89 + * struct blk_zone_range - BLKRESETZONE/BLKOPENZONE/
90 + * BLKCLOSEZONE/BLKFINISHZONE ioctl
91 + * requests
92 + * @sector: Starting sector of the first zone to operate on.
93 + * @nr_sectors: Total number of sectors of all zones to operate on.
95 struct blk_zone_range {
96 __u64 sector;
97 @@ -139,10 +155,19 @@
98 * sector range. The sector range must be zone aligned.
99 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
100 * @BLKGETNRZONES: Get the total number of zones of the device.
101 + * @BLKOPENZONE: Open the zones in the specified sector range.
102 + * The 512 B sector range must be zone aligned.
103 + * @BLKCLOSEZONE: Close the zones in the specified sector range.
104 + * The 512 B sector range must be zone aligned.
105 + * @BLKFINISHZONE: Mark the zones as full in the specified sector range.
106 + * The 512 B sector range must be zone aligned.
108 #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
109 #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
110 #define BLKGETZONESZ _IOR(0x12, 132, __u32)
111 #define BLKGETNRZONES _IOR(0x12, 133, __u32)
112 +#define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range)
113 +#define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range)
114 +#define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range)
116 #endif /* _UAPI_BLKZONED_H */