diff options
| author | Thomas Weißschuh <thomas@t-8ch.de> | 2023-04-26 08:53:28 +0200 |
|---|---|---|
| committer | Thomas Weißschuh <thomas@t-8ch.de> | 2023-05-05 10:57:52 +0200 |
| commit | 4832fd9f36fbb7a12771b8e8df1e749ff14cc462 (patch) | |
| tree | 6d0bd735f68ec71063e32dbe9198b4bb60c0ccd8 | |
| parent | 7d376eb903aa507259698e1ae2ea0e6932e4807e (diff) | |
| download | util-linux-4832fd9f36fbb7a12771b8e8df1e749ff14cc462.tar.gz | |
blockdev: add support for BLKGETZONESZ
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
| -rw-r--r-- | bash-completion/blockdev | 1 | ||||
| -rw-r--r-- | disk-utils/blockdev.8.adoc | 3 | ||||
| -rw-r--r-- | disk-utils/blockdev.c | 11 |
3 files changed, 15 insertions, 0 deletions
diff --git a/bash-completion/blockdev b/bash-completion/blockdev index 48ba8c7326..30eeff5299 100644 --- a/bash-completion/blockdev +++ b/bash-completion/blockdev @@ -13,6 +13,7 @@ _blockdev_module() --getro --getdiscardzeroes --getdiskseq + --getzonesz --getss --getpbsz --getiomin diff --git a/disk-utils/blockdev.8.adoc b/disk-utils/blockdev.8.adoc index 16f1562ee7..4eb3b32145 100644 --- a/disk-utils/blockdev.8.adoc +++ b/disk-utils/blockdev.8.adoc @@ -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. diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index 58ed4df8b8..646043eaae 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -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") |
