]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (btrfs) add debug messages to zoned support
authorKarel Zak <kzak@redhat.com>
Tue, 3 Aug 2021 11:29:16 +0000 (13:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Aug 2021 11:29:16 +0000 (13:29 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/probe.c
libblkid/src/superblocks/btrfs.c

index 0427759ddc4e664bdaef09f193bf21b5ab3a90ae..0207f79c15d5d02cd7cb45b30cb7f25e46b2b6cf 100644 (file)
@@ -1014,8 +1014,8 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
        }
 # endif
 
-       DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%"PRIu64", size=%"PRIu64"",
-                               pr->off, pr->size));
+       DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%"PRIu64", size=%"PRIu64", zonesize=%"PRIu64,
+                               pr->off, pr->size, pr->zone_size));
        DBG(LOWPROBE, ul_debug("whole-disk: %s, regfile: %s",
                blkid_probe_is_wholedisk(pr) ?"YES" : "NO",
                S_ISREG(pr->mode) ? "YES" : "NO"));
index 03aa7e979298d59c03bf2c8a8cdd49c24222c3f6..9aeee6ea15e4c050201367b7ebcffc33db4ad1da 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <assert.h>
+#include <inttypes.h>
 
 #ifdef HAVE_LINUX_BLKZONED_H
 #include <linux/blkzoned.h>
@@ -126,6 +127,10 @@ static int sb_write_pointer(blkid_probe pr, struct blk_zone *zones, uint64_t *wp
                                blkid_probe_get_buffer(pr, bytenr, BTRFS_SUPER_INFO_SIZE);
                        if (!super[i])
                                return -EIO;
+                       DBG(LOWPROBE, ul_debug("(btrfs) checking #%d zone "
+                                               "[start=%" PRIu64", len=%" PRIu64", sb-offset=%" PRIu64"]",
+                                               i, (uint64_t) zones[i].start,
+                                               (uint64_t) zones[i].len, bytenr));
                }
 
                if (super[0]->generation > super[1]->generation)
@@ -140,6 +145,8 @@ static int sb_write_pointer(blkid_probe pr, struct blk_zone *zones, uint64_t *wp
                return -EUCLEAN;
        }
        *wp_ret = sector << SECTOR_SHIFT;
+
+       DBG(LOWPROBE, ul_debug("(btrfs) write pointer: %" PRIu64" sector", sector));
        return 0;
 }
 
@@ -168,6 +175,7 @@ static int sb_log_offset(blkid_probe pr, uint64_t *bytenr_ret)
         */
        for (i = 0; i < BTRFS_NR_SB_LOG_ZONES; i++) {
                if (zones[i].type == BLK_ZONE_TYPE_CONVENTIONAL) {
+                       DBG(LOWPROBE, ul_debug("(btrfs) checking conventional zone"));
                        *bytenr_ret = zones[i].start << SECTOR_SHIFT;
                        ret = 0;
                        goto out;