include/uapi/linux/blkzoned.h

Source file repositories/reference/linux-study-clean/include/uapi/linux/blkzoned.h

File Facts

System
Linux kernel
Corpus path
include/uapi/linux/blkzoned.h
Extension
.h
Size
8504 bytes
Lines
212
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct blk_zone {
	__u64	start;		/* Zone start sector */
	__u64	len;		/* Zone length in number of sectors */
	__u64	wp;		/* Zone write pointer position */
	__u8	type;		/* Zone type */
	__u8	cond;		/* Zone condition */
	__u8	non_seq;	/* Non-sequential write resources active */
	__u8	reset;		/* Reset write pointer recommended */
	__u8	resv[4];
	__u64	capacity;	/* Zone capacity in number of sectors */
	__u8	reserved[24];
};

/**
 * struct blk_zone_report - BLKREPORTZONE ioctl request/reply
 *
 * @sector: starting sector of report
 * @nr_zones: IN maximum / OUT actual
 * @flags: one or more flags as defined by enum blk_zone_report_flags.
 * @flags: one or more flags as defined by enum blk_zone_report_flags.
 *	   With BLKREPORTZONE, this field is ignored as an input and is valid
 *	   only as an output. Using BLKREPORTZONEV2, this field is used as both
 *	   input and output.
 * @zones: Space to hold @nr_zones @zones entries on reply.
 *
 * The array of at most @nr_zones must follow this structure in memory.
 */
struct blk_zone_report {
	__u64		sector;
	__u32		nr_zones;
	__u32		flags;
	struct blk_zone zones[];
};

/**
 * struct blk_zone_range - BLKRESETZONE/BLKOPENZONE/
 *                         BLKCLOSEZONE/BLKFINISHZONE ioctl
 *                         requests
 * @sector: Starting sector of the first zone to operate on.
 * @nr_sectors: Total number of sectors of all zones to operate on.
 */
struct blk_zone_range {
	__u64		sector;
	__u64		nr_sectors;
};

/**
 * Zoned block device ioctl's:
 *
 * @BLKREPORTZONE: Get zone information from a zoned device. Takes a zone report
 *		   as argument. The zone report will start from the zone
 *		   containing the sector specified in struct blk_zone_report.
 *		   The flags field of struct blk_zone_report is used as an
 *		   output only and ignored as an input.
 *		   DEPRECATED, use BLKREPORTZONEV2 instead.
 * @BLKREPORTZONEV2: Same as @BLKREPORTZONE but uses the flags field of
 *		     struct blk_zone_report as an input, allowing to get a zone
 *		     report using cached zone information if the flag
 *		     BLK_ZONE_REP_CACHED is set. In such case, the zone report
 *		     may include zones with the condition @BLK_ZONE_COND_ACTIVE
 *		     (c.f. the description of this condition above for more
 *		     details).
 * @BLKRESETZONE: Reset the write pointer of the zones in the specified
 *                sector range. The sector range must be zone aligned.
 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
 * @BLKGETNRZONES: Get the total number of zones of the device.
 * @BLKOPENZONE: Open the zones in the specified sector range.
 *               The 512 B sector range must be zone aligned.
 * @BLKCLOSEZONE: Close the zones in the specified sector range.
 *                The 512 B sector range must be zone aligned.
 * @BLKFINISHZONE: Mark the zones as full in the specified sector range.
 *                 The 512 B sector range must be zone aligned.
 */
#define BLKREPORTZONE	_IOWR(0x12, 130, struct blk_zone_report)
#define BLKRESETZONE	_IOW(0x12, 131, struct blk_zone_range)
#define BLKGETZONESZ	_IOR(0x12, 132, __u32)
#define BLKGETNRZONES	_IOR(0x12, 133, __u32)
#define BLKOPENZONE	_IOW(0x12, 134, struct blk_zone_range)
#define BLKCLOSEZONE	_IOW(0x12, 135, struct blk_zone_range)
#define BLKFINISHZONE	_IOW(0x12, 136, struct blk_zone_range)
#define BLKREPORTZONEV2	_IOWR(0x12, 142, struct blk_zone_report)

#endif /* _UAPI_BLKZONED_H */

Annotation

Implementation Notes