Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: blkzoned.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* Zoned block devices handling.
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright (C) 2015 Seagate Technology PLC
[4] Fix | Delete
*
[5] Fix | Delete
* Written by: Shaun Tancheff <shaun.tancheff@seagate.com>
[6] Fix | Delete
*
[7] Fix | Delete
* Modified by: Damien Le Moal <damien.lemoal@hgst.com>
[8] Fix | Delete
* Copyright (C) 2016 Western Digital
[9] Fix | Delete
*
[10] Fix | Delete
* This file is licensed under the terms of the GNU General Public
[11] Fix | Delete
* License version 2. This program is licensed "as is" without any
[12] Fix | Delete
* warranty of any kind, whether express or implied.
[13] Fix | Delete
*/
[14] Fix | Delete
#ifndef _BLKZONED_H
[15] Fix | Delete
#define _BLKZONED_H
[16] Fix | Delete
[17] Fix | Delete
#include <linux/types.h>
[18] Fix | Delete
#include <linux/ioctl.h>
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* enum blk_zone_type - Types of zones allowed in a zoned device.
[22] Fix | Delete
*
[23] Fix | Delete
* @BLK_ZONE_TYPE_CONVENTIONAL: The zone has no write pointer and can be writen
[24] Fix | Delete
* randomly. Zone reset has no effect on the zone.
[25] Fix | Delete
* @BLK_ZONE_TYPE_SEQWRITE_REQ: The zone must be written sequentially
[26] Fix | Delete
* @BLK_ZONE_TYPE_SEQWRITE_PREF: The zone can be written non-sequentially
[27] Fix | Delete
*
[28] Fix | Delete
* Any other value not defined is reserved and must be considered as invalid.
[29] Fix | Delete
*/
[30] Fix | Delete
enum blk_zone_type {
[31] Fix | Delete
BLK_ZONE_TYPE_CONVENTIONAL = 0x1,
[32] Fix | Delete
BLK_ZONE_TYPE_SEQWRITE_REQ = 0x2,
[33] Fix | Delete
BLK_ZONE_TYPE_SEQWRITE_PREF = 0x3,
[34] Fix | Delete
};
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* enum blk_zone_cond - Condition [state] of a zone in a zoned device.
[38] Fix | Delete
*
[39] Fix | Delete
* @BLK_ZONE_COND_NOT_WP: The zone has no write pointer, it is conventional.
[40] Fix | Delete
* @BLK_ZONE_COND_EMPTY: The zone is empty.
[41] Fix | Delete
* @BLK_ZONE_COND_IMP_OPEN: The zone is open, but not explicitly opened.
[42] Fix | Delete
* @BLK_ZONE_COND_EXP_OPEN: The zones was explicitly opened by an
[43] Fix | Delete
* OPEN ZONE command.
[44] Fix | Delete
* @BLK_ZONE_COND_CLOSED: The zone was [explicitly] closed after writing.
[45] Fix | Delete
* @BLK_ZONE_COND_FULL: The zone is marked as full, possibly by a zone
[46] Fix | Delete
* FINISH ZONE command.
[47] Fix | Delete
* @BLK_ZONE_COND_READONLY: The zone is read-only.
[48] Fix | Delete
* @BLK_ZONE_COND_OFFLINE: The zone is offline (sectors cannot be read/written).
[49] Fix | Delete
*
[50] Fix | Delete
* The Zone Condition state machine in the ZBC/ZAC standards maps the above
[51] Fix | Delete
* deinitions as:
[52] Fix | Delete
* - ZC1: Empty | BLK_ZONE_EMPTY
[53] Fix | Delete
* - ZC2: Implicit Open | BLK_ZONE_COND_IMP_OPEN
[54] Fix | Delete
* - ZC3: Explicit Open | BLK_ZONE_COND_EXP_OPEN
[55] Fix | Delete
* - ZC4: Closed | BLK_ZONE_CLOSED
[56] Fix | Delete
* - ZC5: Full | BLK_ZONE_FULL
[57] Fix | Delete
* - ZC6: Read Only | BLK_ZONE_READONLY
[58] Fix | Delete
* - ZC7: Offline | BLK_ZONE_OFFLINE
[59] Fix | Delete
*
[60] Fix | Delete
* Conditions 0x5 to 0xC are reserved by the current ZBC/ZAC spec and should
[61] Fix | Delete
* be considered invalid.
[62] Fix | Delete
*/
[63] Fix | Delete
enum blk_zone_cond {
[64] Fix | Delete
BLK_ZONE_COND_NOT_WP = 0x0,
[65] Fix | Delete
BLK_ZONE_COND_EMPTY = 0x1,
[66] Fix | Delete
BLK_ZONE_COND_IMP_OPEN = 0x2,
[67] Fix | Delete
BLK_ZONE_COND_EXP_OPEN = 0x3,
[68] Fix | Delete
BLK_ZONE_COND_CLOSED = 0x4,
[69] Fix | Delete
BLK_ZONE_COND_READONLY = 0xD,
[70] Fix | Delete
BLK_ZONE_COND_FULL = 0xE,
[71] Fix | Delete
BLK_ZONE_COND_OFFLINE = 0xF,
[72] Fix | Delete
};
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* enum blk_zone_report_flags - Feature flags of reported zone descriptors.
[76] Fix | Delete
*
[77] Fix | Delete
* @BLK_ZONE_REP_CAPACITY: Zone descriptor has capacity field.
[78] Fix | Delete
*/
[79] Fix | Delete
enum blk_zone_report_flags {
[80] Fix | Delete
BLK_ZONE_REP_CAPACITY = (1 << 0),
[81] Fix | Delete
};
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl.
[85] Fix | Delete
*
[86] Fix | Delete
* @start: Zone start in 512 B sector units
[87] Fix | Delete
* @len: Zone length in 512 B sector units
[88] Fix | Delete
* @wp: Zone write pointer location in 512 B sector units
[89] Fix | Delete
* @type: see enum blk_zone_type for possible values
[90] Fix | Delete
* @cond: see enum blk_zone_cond for possible values
[91] Fix | Delete
* @non_seq: Flag indicating that the zone is using non-sequential resources
[92] Fix | Delete
* (for host-aware zoned block devices only).
[93] Fix | Delete
* @reset: Flag indicating that a zone reset is recommended.
[94] Fix | Delete
* @resv: Padding for 8B alignment.
[95] Fix | Delete
* @capacity: Zone usable capacity in 512 B sector units
[96] Fix | Delete
* @reserved: Padding to 64 B to match the ZBC, ZAC and ZNS defined zone
[97] Fix | Delete
* descriptor size.
[98] Fix | Delete
*
[99] Fix | Delete
* start, len, capacity and wp use the regular 512 B sector unit, regardless
[100] Fix | Delete
* of the device logical block size. The overall structure size is 64 B to
[101] Fix | Delete
* match the ZBC, ZAC and ZNS defined zone descriptor and allow support for
[102] Fix | Delete
* future additional zone information.
[103] Fix | Delete
*/
[104] Fix | Delete
struct blk_zone {
[105] Fix | Delete
__u64 start; /* Zone start sector */
[106] Fix | Delete
__u64 len; /* Zone length in number of sectors */
[107] Fix | Delete
__u64 wp; /* Zone write pointer position */
[108] Fix | Delete
__u8 type; /* Zone type */
[109] Fix | Delete
__u8 cond; /* Zone condition */
[110] Fix | Delete
__u8 non_seq; /* Non-sequential write resources active */
[111] Fix | Delete
__u8 reset; /* Reset write pointer recommended */
[112] Fix | Delete
#ifdef __GENKSYMS__
[113] Fix | Delete
__u8 reserved[36];
[114] Fix | Delete
#else
[115] Fix | Delete
__u8 resv[4];
[116] Fix | Delete
__u64 capacity; /* Zone capacity in number of sectors */
[117] Fix | Delete
__u8 reserved[24];
[118] Fix | Delete
#endif
[119] Fix | Delete
};
[120] Fix | Delete
[121] Fix | Delete
/**
[122] Fix | Delete
* struct blk_zone_report - BLKREPORTZONE ioctl request/reply
[123] Fix | Delete
*
[124] Fix | Delete
* @sector: starting sector of report
[125] Fix | Delete
* @nr_zones: IN maximum / OUT actual
[126] Fix | Delete
* @flags: one or more flags as defined by enum blk_zone_report_flags.
[127] Fix | Delete
* @zones: Space to hold @nr_zones @zones entries on reply.
[128] Fix | Delete
*
[129] Fix | Delete
* The array of at most @nr_zones must follow this structure in memory.
[130] Fix | Delete
*/
[131] Fix | Delete
struct blk_zone_report {
[132] Fix | Delete
__u64 sector;
[133] Fix | Delete
__u32 nr_zones;
[134] Fix | Delete
#ifdef __GENKSYMS__
[135] Fix | Delete
[136] Fix | Delete
__u8 reserved[4];
[137] Fix | Delete
#else
[138] Fix | Delete
[139] Fix | Delete
__u32 flags;
[140] Fix | Delete
#endif
[141] Fix | Delete
struct blk_zone zones[0];
[142] Fix | Delete
};
[143] Fix | Delete
[144] Fix | Delete
/**
[145] Fix | Delete
* struct blk_zone_range - BLKRESETZONE/BLKOPENZONE/
[146] Fix | Delete
* BLKCLOSEZONE/BLKFINISHZONE ioctl
[147] Fix | Delete
* requests
[148] Fix | Delete
* @sector: Starting sector of the first zone to operate on.
[149] Fix | Delete
* @nr_sectors: Total number of sectors of all zones to operate on.
[150] Fix | Delete
*/
[151] Fix | Delete
struct blk_zone_range {
[152] Fix | Delete
__u64 sector;
[153] Fix | Delete
__u64 nr_sectors;
[154] Fix | Delete
};
[155] Fix | Delete
[156] Fix | Delete
/**
[157] Fix | Delete
* Zoned block device ioctl's:
[158] Fix | Delete
*
[159] Fix | Delete
* @BLKREPORTZONE: Get zone information. Takes a zone report as argument.
[160] Fix | Delete
* The zone report will start from the zone containing the
[161] Fix | Delete
* sector specified in the report request structure.
[162] Fix | Delete
* @BLKRESETZONE: Reset the write pointer of the zones in the specified
[163] Fix | Delete
* sector range. The sector range must be zone aligned.
[164] Fix | Delete
* @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
[165] Fix | Delete
* @BLKGETNRZONES: Get the total number of zones of the device.
[166] Fix | Delete
* @BLKOPENZONE: Open the zones in the specified sector range.
[167] Fix | Delete
* The 512 B sector range must be zone aligned.
[168] Fix | Delete
* @BLKCLOSEZONE: Close the zones in the specified sector range.
[169] Fix | Delete
* The 512 B sector range must be zone aligned.
[170] Fix | Delete
* @BLKFINISHZONE: Mark the zones as full in the specified sector range.
[171] Fix | Delete
* The 512 B sector range must be zone aligned.
[172] Fix | Delete
*/
[173] Fix | Delete
#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
[174] Fix | Delete
#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
[175] Fix | Delete
#define BLKGETZONESZ _IOR(0x12, 132, __u32)
[176] Fix | Delete
#define BLKGETNRZONES _IOR(0x12, 133, __u32)
[177] Fix | Delete
#define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range)
[178] Fix | Delete
#define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range)
[179] Fix | Delete
#define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range)
[180] Fix | Delete
[181] Fix | Delete
#endif /* _BLKZONED_H */
[182] Fix | Delete
[183] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function