From: Thomas Weißschuh Date: Tue, 27 Dec 2022 00:28:53 +0000 (+0000) Subject: blockdev: add support for ioctl BLKGETDISKSEQ X-Git-Tag: v2.39-rc1~352^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c10adc203e4aa577362319ee218b5cd3fa49f74f;p=thirdparty%2Futil-linux.git blockdev: add support for ioctl BLKGETDISKSEQ --- diff --git a/disk-utils/blockdev.8.adoc b/disk-utils/blockdev.8.adoc index 8e8c3326c5..16f1562ee7 100644 --- a/disk-utils/blockdev.8.adoc +++ b/disk-utils/blockdev.8.adoc @@ -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. diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index 6721560f66..58ed4df8b8 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -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", diff --git a/include/blkdev.h b/include/blkdev.h index 43a5f52248..ffecdcba01 100644 --- a/include/blkdev.h +++ b/include/blkdev.h @@ -64,6 +64,11 @@ # 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 */