]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blockdev: add support for ioctl BLKGETDISKSEQ
authorThomas Weißschuh <thomas@t-8ch.de>
Tue, 27 Dec 2022 00:28:53 +0000 (00:28 +0000)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 28 Dec 2022 12:33:49 +0000 (12:33 +0000)
disk-utils/blockdev.8.adoc
disk-utils/blockdev.c
include/blkdev.h

index 8e8c3326c5581e263cc20eb939042071c0619fd0..16f1562ee7eb996a618def9c7bee111d443d2aa0 100644 (file)
@@ -57,6 +57,9 @@ Print the blocksize in bytes. This size does not describe device topology. It's
 *--getdiscardzeroes*::
 Get discard zeroes support status.
 
+*--getdiskseq*::
+Get disk sequence number.
+
 *--getfra*::
 Get filesystem readahead in 512-byte sectors.
 
index 6721560f66747d8af80c57d174da0b986ede1fca..58ed4df8b8eb12059c727d06ed7a21b6206b44d2 100644 (file)
@@ -168,6 +168,12 @@ static const struct bdc bdcms[] =
                .argtype = ARG_LONG,
                .argval = -1,
                .help = N_("get filesystem readahead")
+       },{
+               IOCTL_ENTRY(BLKGETDISKSEQ),
+               .name = "--getdiskseq",
+               .argtype = ARG_ULLONG,
+               .argval = -1,
+               .help = N_("get disk sequence number")
        },{
                IOCTL_ENTRY(BLKFLSBUF),
                .name = "--flushbufs",
index 43a5f522485714db5f39f33733cc6f392097e9c8..ffecdcba013abd0ac043607ebe7ab63f490dea13 100644 (file)
 #  define BLKDISCARDZEROES _IO(0x12,124)
 # endif
 
+/* disk sequence number, introduced in 5.15 (commit 7957d93b) */
+# ifndef BLKGETDISKSEQ
+#  define BLKGETDISKSEQ _IOR(0x12, 128, uint64_t)
+# endif
+
 /* filesystem freeze, introduced in 2.6.29 (commit fcccf502) */
 # ifndef FIFREEZE
 #  define FIFREEZE   _IOWR('X', 119, int)    /* Freeze */