diff options
author | Karel Zak <kzak@redhat.com> | 2023-05-17 13:26:34 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2023-05-17 13:26:34 +0200 |
commit | 976157c821d81080b707315dfa17bbff87e9f5ca (patch) | |
tree | 9b4aec12e6100ffbb446223dfb436ebfd548afbe | |
parent | 747fe9946ad844ddb6a6f6509980c2161857bc2d (diff) | |
parent | 4832fd9f36fbb7a12771b8e8df1e749ff14cc462 (diff) | |
download | util-linux-976157c821d81080b707315dfa17bbff87e9f5ca.tar.gz |
Merge branch 'blockdev/zonesz' of https://github.com/t-8ch/util-linux
* 'blockdev/zonesz' of https://github.com/t-8ch/util-linux:
blockdev: add support for BLKGETZONESZ
-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 48ba8c732..30eeff529 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 16f1562ee..4eb3b3214 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 58ed4df8b..646043eaa 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") |