]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blockdev: add support for BLKGETZONESZ
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 26 Apr 2023 06:53:28 +0000 (08:53 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 5 May 2023 08:57:52 +0000 (10:57 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
bash-completion/blockdev
disk-utils/blockdev.8.adoc
disk-utils/blockdev.c

index 48ba8c73260939ad96a03c0d75df3c991b4abdc7..30eeff5299602adfb01ca8ebf04b6ee4539729ca 100644 (file)
@@ -13,6 +13,7 @@ _blockdev_module()
                --getro
                --getdiscardzeroes
                --getdiskseq
+               --getzonesz
                --getss
                --getpbsz
                --getiomin
index 16f1562ee7eb996a618def9c7bee111d443d2aa0..4eb3b32145e7cf4b8eb6bebe3cd54ec57df6f10d 100644 (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.
 
index 58ed4df8b8eb12059c727d06ed7a21b6206b44d2..646043eaaef7ace65e96c532887ccf730c099102 100644 (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")