]> git.ipfire.org Git - thirdparty/util-linux.git/commit
blkzone: add open/close/finish commands
authorAravind Ramesh <Aravind.Ramesh@wdc.com>
Tue, 24 Mar 2020 10:02:17 +0000 (19:02 +0900)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Mar 2020 11:27:13 +0000 (12:27 +0100)
commit0cecae9c03b4d197279fe96899722088d389bdce
treed4786f752ee92538f77d81969d9868be45e67280
parente7db499f1c12712f31aaaf5f8b0d594b3b8c40de
blkzone: add open/close/finish commands

Introduce blkzone open, close and finish commands, issuing BLKOPENZONE,
BLKCLOSEZONE and BLKFINISHZONE ioctl commands to open, close or finish
a range of zones of a zoned block device.

Since these three commands are similar to the existing zone reset
command, the existing zone reset command implementation is changed into
the generic blkzone_action() internal handler function for processing
all zone actions.

The BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl commands codes are
defined in linux/blkzoned.h starting with kernel version 5.5. To ensure
that the blkzone utility compiles even with older blkzoned.h kernel
header versions, these ioctl commands are internally defined if the
blkzoned.h header definition is not present. Execution of these commands
on kernels older than 5.5 will result in a -ENOTTY error (missing
ioctl).

Signed-off-by: Aravind Ramesh <Aravind.Ramesh@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Tested-by: Hans Holmberg <Hans.Holmberg@wdc.com>
Reviewed-by: Hans Holmberg <Hans.Holmberg@wdc.com>
sys-utils/blkzone.8
sys-utils/blkzone.c