]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (bcache) report version
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 3 Jun 2023 09:15:13 +0000 (11:15 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 3 Jun 2023 11:51:22 +0000 (13:51 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/superblocks/bcache.c
tests/expected/blkid/low-probe-bcache-B
tests/expected/blkid/low-probe-bcache-C
tests/expected/blkid/low-probe-bcache-journal

index c3c84105a04115d044137b7bee4e9d2d3fe04c0a..a4a33614a3924eb93153f09f052e3e6709eaaeb5 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <stddef.h>
 #include <stdio.h>
+#include <inttypes.h>
 
 #include "superblocks.h"
 #include "crc32c.h"
@@ -184,6 +185,9 @@ static int probe_bcache (blkid_probe pr, const struct blkid_idmag *mag)
        if (le64_to_cpu(bcs->offset) != BCACHE_SB_OFF / 512)
                return BLKID_PROBE_NONE;
 
+       if (blkid_probe_sprintf_version(pr, "%"PRIu64, le64_to_cpu(bcs->version)) < 0)
+               return BLKID_PROBE_NONE;
+
        if (blkid_probe_set_uuid(pr, bcs->uuid) < 0)
                return BLKID_PROBE_NONE;
 
index 739663208801017907891fe3df853c2e9e05d687..65932092524cb40e4960960ff7abe8b1887353df 100644 (file)
@@ -2,3 +2,4 @@ ID_FS_TYPE=bcache
 ID_FS_USAGE=other
 ID_FS_UUID=8fb7f716-4c19-4517-bfbb-6f4a2becad60
 ID_FS_UUID_ENC=8fb7f716-4c19-4517-bfbb-6f4a2becad60
+ID_FS_VERSION=1
index b3c5f88f99ef3424194817a61fae9ecd66ba22ef..2188211b8427357c0386a1a8b533d47a7bdd8796 100644 (file)
@@ -2,3 +2,4 @@ ID_FS_TYPE=bcache
 ID_FS_USAGE=other
 ID_FS_UUID=7a343627-ac87-4bf0-b76f-46067cbc9b8c
 ID_FS_UUID_ENC=7a343627-ac87-4bf0-b76f-46067cbc9b8c
+ID_FS_VERSION=0
index d61ea279f0ba77433aa4b6099e1741109d591d23..966c3eff1f6816627174f1912cad96df9e0779a0 100644 (file)
@@ -4,3 +4,4 @@ ID_FS_TYPE=bcache
 ID_FS_USAGE=other
 ID_FS_UUID=fc6ea56f-372e-474e-bc5b-2ddc8430ddd1
 ID_FS_UUID_ENC=fc6ea56f-372e-474e-bc5b-2ddc8430ddd1
+ID_FS_VERSION=3