blockdev: add support for BLKGETZONESZ

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
This commit is contained in:
Thomas Weißschuh 2023-04-26 08:53:28 +02:00
parent 7d376eb903
commit 4832fd9f36
3 changed files with 15 additions and 0 deletions

View file

@ -13,6 +13,7 @@ _blockdev_module()
--getro
--getdiscardzeroes
--getdiskseq
--getzonesz
--getss
--getpbsz
--getiomin

View file

@ -60,6 +60,9 @@ Get discard zeroes support status.
*--getdiskseq*::
Get disk sequence number.
*--getzonesz*::
Get zone size in 512-byte sectors.
*--getfra*::
Get filesystem readahead in 512-byte sectors.

View file

@ -10,6 +10,9 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
#ifdef HAVE_LINUX_BLKZONED_H
#include <linux/blkzoned.h>
#endif
#include "c.h"
#include "nls.h"
@ -175,6 +178,14 @@ static const struct bdc bdcms[] =
.argval = -1,
.help = N_("get disk sequence number")
},{
#ifdef HAVE_LINUX_BLKZONED_H
IOCTL_ENTRY(BLKGETZONESZ),
.name = "--getzonesz",
.argtype = ARG_UINT,
.argval = -1,
.help = N_("get zone size")
},{
#endif
IOCTL_ENTRY(BLKFLSBUF),
.name = "--flushbufs",
.help = N_("flush buffers")