summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2014-03-21 12:34:50 +0100
committerKarel Zak2014-03-21 12:34:50 +0100
commitc62a6311ee95556bdaf12106a6a1f8c353322ccd (patch)
treed82391d43277f80ac98ec5853d484183b016d893
parentlibmount: use new debug functions (diff)
downloadkernel-qcow2-util-linux-c62a6311ee95556bdaf12106a6a1f8c353322ccd.tar.gz
kernel-qcow2-util-linux-c62a6311ee95556bdaf12106a6a1f8c353322ccd.tar.xz
kernel-qcow2-util-linux-c62a6311ee95556bdaf12106a6a1f8c353322ccd.zip
libblkid: use new debug functions
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--libblkid/src/blkidP.h22
-rw-r--r--libblkid/src/cache.c12
-rw-r--r--libblkid/src/config.c12
-rw-r--r--libblkid/src/dev.c4
-rw-r--r--libblkid/src/devname.c36
-rw-r--r--libblkid/src/devno.c10
-rw-r--r--libblkid/src/evaluate.c22
-rw-r--r--libblkid/src/init.c2
-rw-r--r--libblkid/src/partitions/bsd.c8
-rw-r--r--libblkid/src/partitions/dos.c6
-rw-r--r--libblkid/src/partitions/gpt.c16
-rw-r--r--libblkid/src/partitions/mac.c2
-rw-r--r--libblkid/src/partitions/minix.c2
-rw-r--r--libblkid/src/partitions/partitions.c42
-rw-r--r--libblkid/src/partitions/sgi.c2
-rw-r--r--libblkid/src/partitions/solaris_x86.c4
-rw-r--r--libblkid/src/partitions/sun.c4
-rw-r--r--libblkid/src/partitions/unixware.c2
-rw-r--r--libblkid/src/probe.c70
-rw-r--r--libblkid/src/read.c28
-rw-r--r--libblkid/src/resolve.c4
-rw-r--r--libblkid/src/save.c22
-rw-r--r--libblkid/src/superblocks/ext.c2
-rw-r--r--libblkid/src/superblocks/minix.c2
-rw-r--r--libblkid/src/superblocks/nilfs.c2
-rw-r--r--libblkid/src/superblocks/ntfs.c2
-rw-r--r--libblkid/src/superblocks/superblocks.c18
-rw-r--r--libblkid/src/superblocks/swap.c4
-rw-r--r--libblkid/src/superblocks/vfat.c4
-rw-r--r--libblkid/src/tag.c14
-rw-r--r--libblkid/src/topology/dm.c6
-rw-r--r--libblkid/src/topology/lvm.c6
-rw-r--r--libblkid/src/topology/topology.c10
-rw-r--r--libblkid/src/verify.c12
34 files changed, 196 insertions, 218 deletions
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h
index b66965106..0ac11737e 100644
--- a/libblkid/src/blkidP.h
+++ b/libblkid/src/blkidP.h
@@ -13,9 +13,6 @@
#ifndef _BLKID_BLKIDP_H
#define _BLKID_BLKIDP_H
-/* support debug output if LIBBLKID_DEBUG env. variable is set */
-#define CONFIG_BLKID_DEBUG 1
-
/* Always confirm that /dev/disk-by symlinks match with LABEL/UUID on device */
/* #define CONFIG_BLKID_VERIFY_UDEV 1 */
@@ -318,10 +315,6 @@ struct blkid_struct_cache
#define BLKID_PRI_LVM 20
#define BLKID_PRI_MD 10
-#if defined(TEST_PROGRAM) && !defined(CONFIG_BLKID_DEBUG)
-#define CONFIG_BLKID_DEBUG
-#endif
-
#define BLKID_DEBUG_CACHE 0x0001
#define BLKID_DEBUG_DUMP 0x0002
#define BLKID_DEBUG_DEV 0x0004
@@ -338,23 +331,12 @@ struct blkid_struct_cache
#define BLKID_DEBUG_INIT 0x8000
#define BLKID_DEBUG_ALL 0xFFFF
-#define BLKID_DEF_FLAG(m) UL_DEFINE_FLAG(BLKID_DEBUG_, m)
-
UL_DEBUG_DECLARE_MASK(libblkid);
+#define DBG(m, x) __UL_DBG(libblkid, BLKID_DEBUG_, m, x)
+
extern void blkid_debug_dump_dev(blkid_dev dev);
extern void blkid_debug_dump_tag(blkid_tag tag);
-#define DBG(m, x) do { __UL_DBG(libblkid, BLKID_DEBUG_, m, x); } while (0)
-
-static inline void __attribute__ ((__format__ (__printf__, 1, 2)))
-blkid_debug(const char *mesg, ...)
-{
- va_list ap;
- va_start(ap, mesg);
- vfprintf(stderr, mesg, ap);
- va_end(ap);
- fputc('\n', stderr);
-}
/* devno.c */
struct dir_list {
diff --git a/libblkid/src/cache.c b/libblkid/src/cache.c
index dfbf7e034..b576df8b4 100644
--- a/libblkid/src/cache.c
+++ b/libblkid/src/cache.c
@@ -99,7 +99,7 @@ int blkid_get_cache(blkid_cache *ret_cache, const char *filename)
blkid_init_debug(0);
- DBG(CACHE, blkid_debug("creating blkid cache (using %s)",
+ DBG(CACHE, ul_debug("creating blkid cache (using %s)",
filename ? filename : "default cache"));
if (!(cache = (blkid_cache) calloc(1, sizeof(struct blkid_struct_cache))))
@@ -133,9 +133,9 @@ void blkid_put_cache(blkid_cache cache)
(void) blkid_flush_cache(cache);
- DBG(CACHE, blkid_debug("freeing cache struct"));
+ DBG(CACHE, ul_debug("freeing cache struct"));
- /* DBG(CACHE, blkid_debug_dump_cache(cache)); */
+ /* DBG(CACHE, ul_debug_dump_cache(cache)); */
while (!list_empty(&cache->bic_devs)) {
blkid_dev dev = list_entry(cache->bic_devs.next,
@@ -154,7 +154,7 @@ void blkid_put_cache(blkid_cache cache)
struct blkid_struct_tag,
bit_names);
- DBG(CACHE, blkid_debug("warning: unfreed tag %s=%s",
+ DBG(CACHE, ul_debug("warning: unfreed tag %s=%s",
bad->bit_name, bad->bit_val));
blkid_free_tag(bad);
}
@@ -184,11 +184,11 @@ void blkid_gc_cache(blkid_cache cache)
list_for_each_safe(p, pnext, &cache->bic_devs) {
blkid_dev dev = list_entry(p, struct blkid_struct_dev, bid_devs);
if (stat(dev->bid_name, &st) < 0) {
- DBG(CACHE, blkid_debug("freeing %s", dev->bid_name));
+ DBG(CACHE, ul_debug("freeing %s", dev->bid_name));
blkid_free_dev(dev);
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
} else {
- DBG(CACHE, blkid_debug("Device %s exists", dev->bid_name));
+ DBG(CACHE, ul_debug("Device %s exists", dev->bid_name));
}
}
}
diff --git a/libblkid/src/config.c b/libblkid/src/config.c
index 124e8a78e..3c7f3124c 100644
--- a/libblkid/src/config.c
+++ b/libblkid/src/config.c
@@ -50,7 +50,7 @@ static int parse_evaluate(struct blkid_config *conf, char *s)
}
return 0;
err:
- DBG(CONFIG, blkid_debug(
+ DBG(CONFIG, ul_debug(
"config file: unknown evaluation method '%s'.", s));
return -1;
}
@@ -71,7 +71,7 @@ static int parse_next(FILE *fd, struct blkid_config *conf)
if (feof(fd))
s = strchr (buf, '\0');
else {
- DBG(CONFIG, blkid_debug(
+ DBG(CONFIG, ul_debug(
"config file: missing newline at line '%s'.",
buf));
return -1;
@@ -102,7 +102,7 @@ static int parse_next(FILE *fd, struct blkid_config *conf)
if (*s && parse_evaluate(conf, s) == -1)
return -1;
} else {
- DBG(CONFIG, blkid_debug(
+ DBG(CONFIG, ul_debug(
"config file: unknown option '%s'.", s));
return -1;
}
@@ -125,16 +125,16 @@ struct blkid_config *blkid_read_config(const char *filename)
return NULL;
conf->uevent = -1;
- DBG(CONFIG, blkid_debug("reading config file: %s.", filename));
+ DBG(CONFIG, ul_debug("reading config file: %s.", filename));
f = fopen(filename, "r" UL_CLOEXECSTR);
if (!f) {
- DBG(CONFIG, blkid_debug("%s: does not exist, using built-in default", filename));
+ DBG(CONFIG, ul_debug("%s: does not exist, using built-in default", filename));
goto dflt;
}
while (!feof(f)) {
if (parse_next(f, conf)) {
- DBG(CONFIG, blkid_debug("%s: parse error", filename));
+ DBG(CONFIG, ul_debug("%s: parse error", filename));
goto err;
}
}
diff --git a/libblkid/src/dev.c b/libblkid/src/dev.c
index a4b2aea91..9491331ab 100644
--- a/libblkid/src/dev.c
+++ b/libblkid/src/dev.c
@@ -49,7 +49,7 @@ void blkid_free_dev(blkid_dev dev)
return;
DBG(DEV,
- blkid_debug(" freeing dev %s (%s)", dev->bid_name, dev->bid_type ?
+ ul_debug(" freeing dev %s (%s)", dev->bid_name, dev->bid_type ?
dev->bid_type : "(null)"));
DBG(DEV, blkid_debug_dump_dev(dev));
@@ -72,7 +72,6 @@ const char *blkid_dev_devname(blkid_dev dev)
return dev ? dev->bid_name : NULL;
}
-#ifdef CONFIG_BLKID_DEBUG
void blkid_debug_dump_dev(blkid_dev dev)
{
struct list_head *p;
@@ -97,7 +96,6 @@ void blkid_debug_dump_dev(blkid_dev dev)
fprintf(stderr, " tag: NULL\n");
}
}
-#endif
/*
* dev iteration routines for the public libblkid interface.
diff --git a/libblkid/src/devname.c b/libblkid/src/devname.c
index 497deaf14..fdbb5c99a 100644
--- a/libblkid/src/devname.c
+++ b/libblkid/src/devname.c
@@ -60,7 +60,7 @@ blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
if (strcmp(tmp->bid_name, devname))
continue;
- DBG(DEVNAME, blkid_debug("found devname %s in cache", tmp->bid_name));
+ DBG(DEVNAME, ul_debug("found devname %s in cache", tmp->bid_name));
dev = tmp;
break;
}
@@ -257,9 +257,9 @@ static dev_t lvm_get_devno(const char *lvm_device)
int ma, mi;
dev_t ret = 0;
- DBG(DEVNAME, blkid_debug("opening %s", lvm_device));
+ DBG(DEVNAME, ul_debug("opening %s", lvm_device));
if ((lvf = fopen(lvm_device, "r" UL_CLOEXECSTR)) == NULL) {
- DBG(DEVNAME, blkid_debug("%s: (%d) %m", lvm_device, errno));
+ DBG(DEVNAME, ul_debug("%s: (%d) %m", lvm_device, errno));
return 0;
}
@@ -284,7 +284,7 @@ static void lvm_probe_all(blkid_cache cache, int only_if_new)
if ((vg_list = opendir(VG_DIR)) == NULL)
return;
- DBG(DEVNAME, blkid_debug("probing LVM devices under %s", VG_DIR));
+ DBG(DEVNAME, ul_debug("probing LVM devices under %s", VG_DIR));
while ((vg_iter = readdir(vg_list)) != NULL) {
DIR *lv_list;
@@ -322,7 +322,7 @@ static void lvm_probe_all(blkid_cache cache, int only_if_new)
lv_name);
dev = lvm_get_devno(lvm_device);
sprintf(lvm_device, "%s/%s", vg_name, lv_name);
- DBG(DEVNAME, blkid_debug("LVM dev %s: devno 0x%04X",
+ DBG(DEVNAME, ul_debug("LVM dev %s: devno 0x%04X",
lvm_device,
(unsigned int) dev));
probe_one(cache, lvm_device, dev, BLKID_PRI_LVM,
@@ -354,7 +354,7 @@ evms_probe_all(blkid_cache cache, int only_if_new)
&ma, &mi, &sz, device) != 4)
continue;
- DBG(DEVNAME, blkid_debug("Checking partition %s (%d, %d)",
+ DBG(DEVNAME, ul_debug("Checking partition %s (%d, %d)",
device, ma, mi));
probe_one(cache, device, makedev(ma, mi), BLKID_PRI_EVMS,
@@ -374,7 +374,7 @@ ubi_probe_all(blkid_cache cache, int only_if_new)
DIR *dir;
struct dirent *iter;
- DBG(DEVNAME, blkid_debug("probing UBI volumes under %s",
+ DBG(DEVNAME, ul_debug("probing UBI volumes under %s",
*dirname));
dir = opendir(*dirname);
@@ -404,7 +404,7 @@ ubi_probe_all(blkid_cache cache, int only_if_new)
if (!S_ISCHR(st.st_mode) || !minor(dev))
continue;
- DBG(DEVNAME, blkid_debug("UBI vol %s/%s: devno 0x%04X",
+ DBG(DEVNAME, ul_debug("UBI vol %s/%s: devno 0x%04X",
*dirname, name, (int) dev));
probe_one(cache, name, dev, BLKID_PRI_UBI, only_if_new, 0);
}
@@ -459,7 +459,7 @@ static int probe_all(blkid_cache cache, int only_if_new)
continue;
devs[which] = makedev(ma, mi);
- DBG(DEVNAME, blkid_debug("read partition name %s", ptname));
+ DBG(DEVNAME, ul_debug("read partition name %s", ptname));
/* Skip whole disk devs unless they have no partitions.
* If base name of device has changed, also
@@ -477,7 +477,7 @@ static int probe_all(blkid_cache cache, int only_if_new)
/* ends in a digit, clearly a partition, so check */
if (isdigit(ptname[lens[which] - 1])) {
- DBG(DEVNAME, blkid_debug("partition dev %s, devno 0x%04X",
+ DBG(DEVNAME, ul_debug("partition dev %s, devno 0x%04X",
ptname, (unsigned int) devs[which]));
if (sz > 1)
@@ -499,7 +499,7 @@ static int probe_all(blkid_cache cache, int only_if_new)
tmp = list_entry(p, struct blkid_struct_dev,
bid_devs);
if (tmp->bid_devno == devs[last]) {
- DBG(DEVNAME, blkid_debug("freeing %s",
+ DBG(DEVNAME, ul_debug("freeing %s",
tmp->bid_name));
blkid_free_dev(tmp);
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
@@ -514,7 +514,7 @@ static int probe_all(blkid_cache cache, int only_if_new)
* check last as well.
*/
if (lens[last] && strncmp(ptnames[last], ptname, lens[last])) {
- DBG(DEVNAME, blkid_debug("whole dev %s, devno 0x%04X",
+ DBG(DEVNAME, ul_debug("whole dev %s, devno 0x%04X",
ptnames[last], (unsigned int) devs[last]));
probe_one(cache, ptnames[last], devs[last], 0,
only_if_new, 0);
@@ -590,13 +590,13 @@ int blkid_probe_all(blkid_cache cache)
{
int ret;
- DBG(PROBE, blkid_debug("Begin blkid_probe_all()"));
+ DBG(PROBE, ul_debug("Begin blkid_probe_all()"));
ret = probe_all(cache, 0);
if (ret == 0) {
cache->bic_time = time(0);
cache->bic_flags |= BLKID_BIC_FL_PROBED;
}
- DBG(PROBE, blkid_debug("End blkid_probe_all() [rc=%d]", ret));
+ DBG(PROBE, ul_debug("End blkid_probe_all() [rc=%d]", ret));
return ret;
}
@@ -612,9 +612,9 @@ int blkid_probe_all_new(blkid_cache cache)
{
int ret;
- DBG(PROBE, blkid_debug("Begin blkid_probe_all_new()"));
+ DBG(PROBE, ul_debug("Begin blkid_probe_all_new()"));
ret = probe_all(cache, 1);
- DBG(PROBE, blkid_debug("End blkid_probe_all_new() [rc=%d]", ret));
+ DBG(PROBE, ul_debug("End blkid_probe_all_new() [rc=%d]", ret));
return ret;
}
@@ -640,9 +640,9 @@ int blkid_probe_all_removable(blkid_cache cache)
{
int ret;
- DBG(PROBE, blkid_debug("Begin blkid_probe_all_removable()"));
+ DBG(PROBE, ul_debug("Begin blkid_probe_all_removable()"));
ret = probe_all_removable(cache);
- DBG(PROBE, blkid_debug("End blkid_probe_all_removable() [rc=%d]", ret));
+ DBG(PROBE, ul_debug("End blkid_probe_all_removable() [rc=%d]", ret));
return ret;
}
diff --git a/libblkid/src/devno.c b/libblkid/src/devno.c
index 56f4531a5..2f250cc3b 100644
--- a/libblkid/src/devno.c
+++ b/libblkid/src/devno.c
@@ -131,7 +131,7 @@ void blkid__scan_dir(char *dirname, dev_t devno, struct dir_list **list,
if (S_ISBLK(st.st_mode) && st.st_rdev == devno) {
*devname = blkid_strconcat(dirname, "/", dp->d_name);
- DBG(DEVNO, blkid_debug("found 0x%llx at %s", (long long)devno,
+ DBG(DEVNO, ul_debug("found 0x%llx at %s", (long long)devno,
*devname));
break;
}
@@ -193,7 +193,7 @@ static char *scandev_devno_to_devpath(dev_t devno)
struct dir_list *current = list;
list = list->next;
- DBG(DEVNO, blkid_debug("directory %s", current->name));
+ DBG(DEVNO, ul_debug("directory %s", current->name));
blkid__scan_dir(current->name, devno, &new_list, &devname);
free(current->name);
free(current);
@@ -236,10 +236,10 @@ char *blkid_devno_to_devname(dev_t devno)
path = scandev_devno_to_devpath(devno);
if (!path) {
- DBG(DEVNO, blkid_debug("blkid: couldn't find devno 0x%04lx",
+ DBG(DEVNO, ul_debug("blkid: couldn't find devno 0x%04lx",
(unsigned long) devno));
} else {
- DBG(DEVNO, blkid_debug("found devno 0x%04llx as %s", (long long)devno, path));
+ DBG(DEVNO, ul_debug("found devno 0x%04llx as %s", (long long)devno, path));
}
return path;
@@ -321,7 +321,7 @@ int blkid_driver_has_major(const char *drvname, int major)
fclose(f);
- DBG(DEVNO, blkid_debug("major %d %s associated with '%s' driver",
+ DBG(DEVNO, ul_debug("major %d %s associated with '%s' driver",
major, match ? "is" : "is NOT", drvname));
return match;
}
diff --git a/libblkid/src/evaluate.c b/libblkid/src/evaluate.c
index 8ef927756..ffbe097e4 100644
--- a/libblkid/src/evaluate.c
+++ b/libblkid/src/evaluate.c
@@ -84,7 +84,7 @@ static int verify_tag(const char *devname, const char *name, const char *value)
if (!rc)
rc = memcmp(value, data, len);
done:
- DBG(EVALUATE, blkid_debug("%s: %s verification %s",
+ DBG(EVALUATE, ul_debug("%s: %s verification %s",
devname, name, rc == 0 ? "PASS" : "FAILED"));
if (fd >= 0)
close(fd);
@@ -109,7 +109,7 @@ int blkid_send_uevent(const char *devname, const char *action)
FILE *f;
int rc = -1;
- DBG(EVALUATE, blkid_debug("%s: uevent '%s' requested", devname, action));
+ DBG(EVALUATE, ul_debug("%s: uevent '%s' requested", devname, action));
if (!devname || !action)
return -1;
@@ -125,9 +125,9 @@ int blkid_send_uevent(const char *devname, const char *action)
if (fputs(action, f) >= 0)
rc = 0;
if (close_stream(f) != 0)
- DBG(EVALUATE, blkid_debug("write failed: %s", uevent));
+ DBG(EVALUATE, ul_debug("write failed: %s", uevent));
}
- DBG(EVALUATE, blkid_debug("%s: send uevent %s",
+ DBG(EVALUATE, ul_debug("%s: send uevent %s",
uevent, rc == 0 ? "SUCCES" : "FAILED"));
return rc;
}
@@ -139,7 +139,7 @@ static char *evaluate_by_udev(const char *token, const char *value, int uevent)
size_t len;
struct stat st;
- DBG(EVALUATE, blkid_debug("evaluating by udev %s=%s", token, value));
+ DBG(EVALUATE, ul_debug("evaluating by udev %s=%s", token, value));
if (!strcmp(token, "UUID"))
strcpy(dev, _PATH_DEV_BYUUID "/");
@@ -150,7 +150,7 @@ static char *evaluate_by_udev(const char *token, const char *value, int uevent)
else if (!strcmp(token, "PARTUUID"))
strcpy(dev, _PATH_DEV_BYPARTUUID "/");
else {
- DBG(EVALUATE, blkid_debug("unsupported token %s", token));
+ DBG(EVALUATE, ul_debug("unsupported token %s", token));
return NULL; /* unsupported tag */
}
@@ -158,7 +158,7 @@ static char *evaluate_by_udev(const char *token, const char *value, int uevent)
if (blkid_encode_string(value, &dev[len], sizeof(dev) - len) != 0)
return NULL;
- DBG(EVALUATE, blkid_debug("expected udev link: %s", dev));
+ DBG(EVALUATE, ul_debug("expected udev link: %s", dev));
if (stat(dev, &st))
goto failed; /* link or device does not exist */
@@ -177,7 +177,7 @@ static char *evaluate_by_udev(const char *token, const char *value, int uevent)
return path;
failed:
- DBG(EVALUATE, blkid_debug("failed to evaluate by udev"));
+ DBG(EVALUATE, ul_debug("failed to evaluate by udev"));
if (uevent && path)
blkid_send_uevent(path, "change");
@@ -191,7 +191,7 @@ static char *evaluate_by_scan(const char *token, const char *value,
blkid_cache c = cache ? *cache : NULL;
char *res;
- DBG(EVALUATE, blkid_debug("evaluating by blkid scan %s=%s", token, value));
+ DBG(EVALUATE, ul_debug("evaluating by blkid scan %s=%s", token, value));
if (!c) {
char *cachefile = blkid_get_cache_filename(conf);
@@ -232,7 +232,7 @@ char *blkid_evaluate_tag(const char *token, const char *value, blkid_cache *cach
if (!cache || !*cache)
blkid_init_debug(0);
- DBG(EVALUATE, blkid_debug("evaluating %s%s%s", token, value ? "=" : "",
+ DBG(EVALUATE, ul_debug("evaluating %s%s%s", token, value ? "=" : "",
value ? value : ""));
if (!value) {
@@ -260,7 +260,7 @@ char *blkid_evaluate_tag(const char *token, const char *value, blkid_cache *cach
break;
}
- DBG(EVALUATE, blkid_debug("%s=%s evaluated as %s", token, value, ret));
+ DBG(EVALUATE, ul_debug("%s=%s evaluated as %s", token, value, ret));
out:
blkid_free_config(conf);
free(t);
diff --git a/libblkid/src/init.c b/libblkid/src/init.c
index 13aa09bb6..5b21ce331 100644
--- a/libblkid/src/init.c
+++ b/libblkid/src/init.c
@@ -36,6 +36,6 @@ void blkid_init_debug(int mask)
const char *date = NULL;
blkid_get_library_version(&ver, &date);
- DBG(INIT, blkid_debug("library version: %s [%s]", ver, date));
+ DBG(INIT, ul_debug("library version: %s [%s]", ver, date));
}
}
diff --git a/libblkid/src/partitions/bsd.c b/libblkid/src/partitions/bsd.c
index 366bdc475..1bc0088be 100644
--- a/libblkid/src/partitions/bsd.c
+++ b/libblkid/src/partitions/bsd.c
@@ -70,7 +70,7 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag)
name = "openbsd";
break;
default:
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: BSD label detected on unknown (0x%x) "
"primary partition",
blkid_partition_get_type(parent)));
@@ -88,7 +88,7 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag)
nparts = le16_to_cpu(l->d_npartitions);
else if (le16_to_cpu(l->d_npartitions) > BSD_MAXPARTITIONS)
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: ignore %d more BSD partitions",
le16_to_cpu(l->d_npartitions) - BSD_MAXPARTITIONS));
@@ -105,13 +105,13 @@ static int probe_bsd_pt(blkid_probe pr, const struct blkid_idmag *mag)
if (parent && blkid_partition_get_start(parent) == start
&& blkid_partition_get_size(parent) == size) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: BSD partition (%d) same like parent, "
"ignore", i));
continue;
}
if (parent && !blkid_is_nested_dimension(parent, start, size)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: BSD partition (%d) overflow "
"detected, ignore", i));
continue;
diff --git a/libblkid/src/partitions/dos.c b/libblkid/src/partitions/dos.c
index 346645899..71c9bc85e 100644
--- a/libblkid/src/partitions/dos.c
+++ b/libblkid/src/partitions/dos.c
@@ -159,7 +159,7 @@ static int probe_dos_pt(blkid_probe pr,
* partition table.
*/
if (blkid_probe_is_vfat(pr)) {
- DBG(LOWPROBE, blkid_debug("probably FAT -- ignore"));
+ DBG(LOWPROBE, ul_debug("probably FAT -- ignore"));
goto nothing;
}
@@ -170,7 +170,7 @@ static int probe_dos_pt(blkid_probe pr,
*/
for (p = p0, i = 0; i < 4; i++, p++)
if (p->boot_ind != 0 && p->boot_ind != 0x80) {
- DBG(LOWPROBE, blkid_debug("missing boot indicator -- ignore"));
+ DBG(LOWPROBE, ul_debug("missing boot indicator -- ignore"));
goto nothing;
}
@@ -179,7 +179,7 @@ static int probe_dos_pt(blkid_probe pr,
*/
for (p = p0, i = 0; i < 4; i++, p++) {
if (p->sys_ind == MBR_GPT_PARTITION) {
- DBG(LOWPROBE, blkid_debug("probably GPT -- ignore"));
+ DBG(LOWPROBE, ul_debug("probably GPT -- ignore"));
goto nothing;
}
}
diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c
index 186fbd929..7fccd51a1 100644
--- a/libblkid/src/partitions/gpt.c
+++ b/libblkid/src/partitions/gpt.c
@@ -236,13 +236,13 @@ static struct gpt_header *get_gpt_header(
h->header_crc32 = orgcrc;
if (crc != le32_to_cpu(orgcrc)) {
- DBG(LOWPROBE, blkid_debug("GPT header corrupted"));
+ DBG(LOWPROBE, ul_debug("GPT header corrupted"));
return NULL;
}
/* Valid header has to be at MyLBA */
if (le64_to_cpu(h->my_lba) != lba) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"GPT->MyLBA mismatch with real position"));
return NULL;
}
@@ -252,14 +252,14 @@ static struct gpt_header *get_gpt_header(
/* Check if First and Last usable LBA makes sense */
if (lu < fu || fu > lastlba || lu > lastlba) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"GPT->{First,Last}UsableLBA out of range"));
return NULL;
}
/* The header has to be outside usable range */
if (fu < lba && lba < lu) {
- DBG(LOWPROBE, blkid_debug("GPT header is inside usable area"));
+ DBG(LOWPROBE, ul_debug("GPT header is inside usable area"));
return NULL;
}
@@ -267,7 +267,7 @@ static struct gpt_header *get_gpt_header(
esz = le32_to_cpu(h->num_partition_entries) *
le32_to_cpu(h->sizeof_partition_entry);
if (!esz) {
- DBG(LOWPROBE, blkid_debug("GPT entries undefined"));
+ DBG(LOWPROBE, ul_debug("GPT entries undefined"));
return NULL;
}
@@ -280,14 +280,14 @@ static struct gpt_header *get_gpt_header(
*ents = (struct gpt_entry *) get_lba_buffer(pr,
le64_to_cpu(h->partition_entries_lba), esz);
if (!*ents) {
- DBG(LOWPROBE, blkid_debug("GPT entries unreadable"));
+ DBG(LOWPROBE, ul_debug("GPT entries unreadable"));
return NULL;
}
/* Validate entries */
crc = count_crc32((unsigned char *) *ents, esz);
if (crc != le32_to_cpu(h->partition_entry_array_crc32)) {
- DBG(LOWPROBE, blkid_debug("GPT entries corrupted"));
+ DBG(LOWPROBE, ul_debug("GPT entries corrupted"));
return NULL;
}
@@ -373,7 +373,7 @@ static int probe_gpt_pt(blkid_probe pr,
}
/* the partition has to inside usable range */
if (start < fu || start + size - 1 > lu) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"GPT entry[%d] overflows usable area - ignore",
i));
blkid_partlist_increment_partno(ls);
diff --git a/libblkid/src/partitions/mac.c b/libblkid/src/partitions/mac.c
index 3b302d92f..428260534 100644
--- a/libblkid/src/partitions/mac.c
+++ b/libblkid/src/partitions/mac.c
@@ -139,7 +139,7 @@ static int probe_mac_pt(blkid_probe pr,
goto nothing;
if (be32_to_cpu(p->map_count) != nblks) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"mac: inconsisten map_count in partition map, "
"entry[0]: %d, entry[%d]: %d",
nblks, i - 1,
diff --git a/libblkid/src/partitions/minix.c b/libblkid/src/partitions/minix.c
index 2e2a221fa..6c6cb6b16 100644
--- a/libblkid/src/partitions/minix.c
+++ b/libblkid/src/partitions/minix.c
@@ -66,7 +66,7 @@ static int probe_minix_pt(blkid_probe pr,
size = dos_partition_get_size(p);
if (parent && !blkid_is_nested_dimension(parent, start, size)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: minix partition (%d) overflow "
"detected, ignore", i));
continue;
diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c
index b116546df..abc7dac4e 100644
--- a/libblkid/src/partitions/partitions.c
+++ b/libblkid/src/partitions/partitions.c
@@ -364,7 +364,7 @@ static void reset_partlist(blkid_partlist ls)
ls->next_partno = 1;
INIT_LIST_HEAD(&ls->l_tabs);
- DBG(LOWPROBE, blkid_debug("partlist reset"));
+ DBG(LOWPROBE, ul_debug("partlist reset"));
}
static blkid_partlist partitions_init_data(struct blkid_chain *chn)
@@ -383,7 +383,7 @@ static blkid_partlist partitions_init_data(struct blkid_chain *chn)
reset_partlist(ls);
- DBG(LOWPROBE, blkid_debug("parts: initialized partitions list (%p, size=%d)",
+ DBG(LOWPROBE, ul_debug("parts: initialized partitions list (%p, size=%d)",
ls, ls->nparts_max));
return ls;
}
@@ -418,7 +418,7 @@ blkid_parttable blkid_partlist_new_parttable(blkid_partlist ls,
INIT_LIST_HEAD(&tab->t_tabs);
list_add_tail(&tab->t_tabs, &ls->l_tabs);
- DBG(LOWPROBE, blkid_debug("parts: create a new partition table "
+ DBG(LOWPROBE, ul_debug("parts: create a new partition table "
"(%p, type=%s, offset=%"PRId64")", tab, type, offset));
return tab;
}
@@ -460,7 +460,7 @@ blkid_partition blkid_partlist_add_partition(blkid_partlist ls,
par->start = start;
par->size = size;
- DBG(LOWPROBE, blkid_debug("parts: add partition (%p start=%"
+ DBG(LOWPROBE, ul_debug("parts: add partition (%p start=%"
PRId64 ", size=%" PRId64 ", table=%p)",
par, par->start, par->size, tab));
return par;
@@ -546,7 +546,7 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id,
/* final check by probing function */
if (id->probefunc) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"%s: ---> call probefunc()", id->name));
rc = id->probefunc(pr, mag);
if (rc < 0) {
@@ -554,14 +554,14 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id,
reset_partlist(blkid_probe_get_partlist(pr));
if (chn && !chn->binary)
blkid_probe_chain_reset_vals(pr, chn);
- DBG(LOWPROBE, blkid_debug("%s probefunc failed, rc %d",
+ DBG(LOWPROBE, ul_debug("%s probefunc failed, rc %d",
id->name, rc));
}
if (rc == BLKID_PROBE_OK && mag && chn && !chn->binary)
rc = blkid_probe_set_magic(pr, off, mag->len,
(unsigned char *) mag->magic);
- DBG(LOWPROBE, blkid_debug("%s: <--- (rc = %d)", id->name, rc));
+ DBG(LOWPROBE, ul_debug("%s: <--- (rc = %d)", id->name, rc));
}
nothing:
@@ -586,7 +586,7 @@ static int partitions_probe(blkid_probe pr, struct blkid_chain *chn)
if (!pr->wipe_size && (pr->prob_flags & BLKID_PROBE_FL_IGNORE_PT))
goto details_only;
- DBG(LOWPROBE, blkid_debug("--> starting probing loop [PARTS idx=%d]",
+ DBG(LOWPROBE, ul_debug("--> starting probing loop [PARTS idx=%d]",
chn->idx));
i = chn->idx < 0 ? 0 : chn->idx + 1U;
@@ -619,14 +619,14 @@ static int partitions_probe(blkid_probe pr, struct blkid_chain *chn)
(unsigned char *) name,
strlen(name) + 1);
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [PARTS idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (type=%s) [PARTS idx=%d]",
name, chn->idx));
rc = 0;
break;
}
if (rc != BLKID_PROBE_OK) {
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed=%d) [PARTS idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (failed=%d) [PARTS idx=%d]",
rc, chn->idx));
}
@@ -652,7 +652,7 @@ int blkid_partitions_do_subprobe(blkid_probe pr, blkid_partition parent,
blkid_partlist ls;
blkid_loff_t sz, off;
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"parts: ----> %s subprobe requested (parent=%p)",
id->name, parent));
@@ -664,7 +664,7 @@ int blkid_partitions_do_subprobe(blkid_probe pr, blkid_partition parent,
off = ((blkid_loff_t) parent->start) << 9;
if (off < pr->off || pr->off + pr->size < off + sz) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"ERROR: parts: <---- '%s' subprobe: overflow detected.",
id->name));
return -ENOSPC;
@@ -697,7 +697,7 @@ int blkid_partitions_do_subprobe(blkid_probe pr, blkid_partition parent,
blkid_free_probe(prc); /* free cloned prober */
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"parts: <---- %s subprobe done (parent=%p, rc=%d)",
id->name, parent, rc));
@@ -789,7 +789,7 @@ int blkid_probe_is_covered_by_pt(blkid_probe pr,
blkid_loff_t start, end;
int nparts, i, rc = 0;
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"=> checking if off=%jd size=%jd covered by PT",
offset, size));
@@ -813,7 +813,7 @@ int blkid_probe_is_covered_by_pt(blkid_probe pr,
blkid_partition par = &ls->parts[i];
if (par->start + par->size > (pr->size >> 9)) {
- DBG(LOWPROBE, blkid_debug("partition #%d overflows "
+ DBG(LOWPROBE, ul_debug("partition #%d overflows "
"device (off=%" PRId64 " size=%" PRId64 ")",
par->partno, par->start, par->size));
goto done;
@@ -832,7 +832,7 @@ int blkid_probe_is_covered_by_pt(blkid_probe pr,
done:
blkid_free_probe(prc);
- DBG(LOWPROBE, blkid_debug("<= %s covered by PT", rc ? "IS" : "NOT"));
+ DBG(LOWPROBE, ul_debug("<= %s covered by PT", rc ? "IS" : "NOT"));
return rc;
}
@@ -957,11 +957,11 @@ blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno
if (!ls)
return NULL;
- DBG(LOWPROBE, blkid_debug("triyng to convert devno 0x%llx to partition",
+ DBG(LOWPROBE, ul_debug("triyng to convert devno 0x%llx to partition",
(long long) devno));
if (sysfs_init(&sysfs, devno, NULL)) {
- DBG(LOWPROBE, blkid_debug("failed t init sysfs context"));
+ DBG(LOWPROBE, ul_debug("failed t init sysfs context"));
return NULL;
}
rc = sysfs_read_u64(&sysfs, "size", &size);
@@ -993,7 +993,7 @@ blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno
return NULL;
if (partno) {
- DBG(LOWPROBE, blkid_debug("mapped by DM, using partno %d", partno));
+ DBG(LOWPROBE, ul_debug("mapped by DM, using partno %d", partno));
/*
* Partition mapped by kpartx does not provide "start" offset
@@ -1015,7 +1015,7 @@ blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno
return NULL;
}
- DBG(LOWPROBE, blkid_debug("searching by offset/size"));
+ DBG(LOWPROBE, ul_debug("searching by offset/size"));
for (i = 0; i < ls->nparts; i++) {
blkid_partition par = &ls->parts[i];
@@ -1031,7 +1031,7 @@ blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno
}
- DBG(LOWPROBE, blkid_debug("not found partition for device"));
+ DBG(LOWPROBE, ul_debug("not found partition for device"));
return NULL;
}
diff --git a/libblkid/src/partitions/sgi.c b/libblkid/src/partitions/sgi.c
index 4446e5327..99c0bf1c7 100644
--- a/libblkid/src/partitions/sgi.c
+++ b/libblkid/src/partitions/sgi.c
@@ -32,7 +32,7 @@ static int probe_sgi_pt(blkid_probe pr,
}
if (sgi_pt_checksum(l)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"detected corrupted sgi disk label -- ignore"));
goto nothing;
}
diff --git a/libblkid/src/partitions/solaris_x86.c b/libblkid/src/partitions/solaris_x86.c
index 16ad0f14e..4ac9be5fe 100644
--- a/libblkid/src/partitions/solaris_x86.c
+++ b/libblkid/src/partitions/solaris_x86.c
@@ -76,7 +76,7 @@ static int probe_solaris_pt(blkid_probe pr,
}
if (le32_to_cpu(l->v_version) != 1) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: unsupported solaris x86 version %d, ignore",
le32_to_cpu(l->v_version)));
goto nothing;
@@ -115,7 +115,7 @@ static int probe_solaris_pt(blkid_probe pr,
start += blkid_partition_get_start(parent);
if (parent && !blkid_is_nested_dimension(parent, start, size)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: solaris partition (%d) overflow "
"detected, ignore", i));
continue;
diff --git a/libblkid/src/partitions/sun.c b/libblkid/src/partitions/sun.c
index 306a75896..22ee45042 100644
--- a/libblkid/src/partitions/sun.c
+++ b/libblkid/src/partitions/sun.c
@@ -34,7 +34,7 @@ static int probe_sun_pt(blkid_probe pr,
}
if (sun_pt_checksum(l)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"detected corrupted sun disk label -- ignore"));
goto nothing;
}
@@ -54,7 +54,7 @@ static int probe_sun_pt(blkid_probe pr,
/* sectors per cylinder (partition offset is in cylinders...) */
spc = be16_to_cpu(l->nhead) * be16_to_cpu(l->nsect);
- DBG(LOWPROBE, blkid_debug("Sun VTOC sanity=%u version=%u nparts=%u",
+ DBG(LOWPROBE, ul_debug("Sun VTOC sanity=%u version=%u nparts=%u",
be32_to_cpu(l->vtoc.sanity),
be32_to_cpu(l->vtoc.version),
be16_to_cpu(l->vtoc.nparts)));
diff --git a/libblkid/src/partitions/unixware.c b/libblkid/src/partitions/unixware.c
index 81393fdc9..6742bcf36 100644
--- a/libblkid/src/partitions/unixware.c
+++ b/libblkid/src/partitions/unixware.c
@@ -150,7 +150,7 @@ static int probe_unixware_pt(blkid_probe pr,
size = le32_to_cpu(p->nr_sects);
if (parent && !blkid_is_nested_dimension(parent, start, size)) {
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"WARNING: unixware partition (%d) overflow "
"detected, ignore", i));
continue;
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 526ca6088..deed02a40 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -143,7 +143,7 @@ blkid_probe blkid_new_probe(void)
if (!pr)
return NULL;
- DBG(LOWPROBE, blkid_debug("allocate a new probe %p", pr));
+ DBG(LOWPROBE, ul_debug("allocate a new probe %p", pr));
/* initialize chains */
for (i = 0; i < BLKID_NCHAINS; i++) {
@@ -168,7 +168,7 @@ blkid_probe blkid_clone_probe(blkid_probe parent)
if (!parent)
return NULL;
- DBG(LOWPROBE, blkid_debug("allocate a probe clone"));
+ DBG(LOWPROBE, ul_debug("allocate a probe clone"));
pr = blkid_new_probe();
if (!pr)
@@ -258,7 +258,7 @@ void blkid_free_probe(blkid_probe pr)
blkid_probe_reset_buffer(pr);
blkid_free_probe(pr->disk_probe);
- DBG(LOWPROBE, blkid_debug("free probe %p", pr));
+ DBG(LOWPROBE, ul_debug("free probe %p", pr));
free(pr);
}
@@ -378,7 +378,7 @@ void *blkid_probe_get_binary_data(blkid_probe pr, struct blkid_chain *chn)
if (rc != 0)
return NULL;
- DBG(LOWPROBE, blkid_debug("returning %s binary data", chn->driver->name));
+ DBG(LOWPROBE, ul_debug("returning %s binary data", chn->driver->name));
return chn->data;
}
@@ -424,7 +424,7 @@ static int blkid_probe_dump_filter(blkid_probe pr, int chain)
for (i = 0; i < chn->driver->nidinfos; i++) {
const struct blkid_idinfo *id = chn->driver->idinfos[i];
- DBG(LOWPROBE, blkid_debug("%d: %s: %s",
+ DBG(LOWPROBE, ul_debug("%d: %s: %s",
i,
id->name,
blkid_bmp_get_item(chn->fltr, i)
@@ -483,7 +483,7 @@ int __blkid_probe_invert_filter(blkid_probe pr, int chain)
for (i = 0; i < blkid_bmp_nwords(chn->driver->nidinfos); i++)
chn->fltr[i] = ~chn->fltr[i];
- DBG(LOWPROBE, blkid_debug("probing filter inverted"));
+ DBG(LOWPROBE, ul_debug("probing filter inverted"));
/* blkid_probe_dump_filter(pr, chain); */
return 0;
}
@@ -525,7 +525,7 @@ int __blkid_probe_filter_types(blkid_probe pr, int chain, int flag, char *names[
}
}
- DBG(LOWPROBE, blkid_debug("%s: a new probing type-filter initialized",
+ DBG(LOWPROBE, ul_debug("%s: a new probing type-filter initialized",
chn->driver->name));
/* blkid_probe_dump_filter(pr, chain); */
return 0;
@@ -560,7 +560,7 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
list_entry(p, struct blkid_bufinfo, bufs);
if (x->off <= off && off + len <= x->off + x->len) {
- DBG(LOWPROBE, blkid_debug("\treuse buffer: off=%jd len=%jd pr=%p",
+ DBG(LOWPROBE, ul_debug("\treuse buffer: off=%jd len=%jd pr=%p",
x->off, x->len, pr));
bf = x;
break;
@@ -586,12 +586,12 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
bf->off = off;
INIT_LIST_HEAD(&bf->bufs);
- DBG(LOWPROBE, blkid_debug("\tbuffer read: off=%jd len=%jd pr=%p",
+ DBG(LOWPROBE, ul_debug("\tbuffer read: off=%jd len=%jd pr=%p",
off, len, pr));
ret = read(pr->fd, bf->data, len);
if (ret != (ssize_t) len) {
- DBG(LOWPROBE, blkid_debug("\tbuffer read: return %zd error %m", ret));
+ DBG(LOWPROBE, ul_debug("\tbuffer read: return %zd error %m", ret));
free(bf);
if (ret >= 0)
errno = 0;
@@ -611,7 +611,7 @@ static void blkid_probe_reset_buffer(blkid_probe pr)
if (!pr || list_empty(&pr->buffers))
return;
- DBG(LOWPROBE, blkid_debug("reseting probing buffers pr=%p", pr));
+ DBG(LOWPROBE, ul_debug("reseting probing buffers pr=%p", pr));
while (!list_empty(&pr->buffers)) {
struct blkid_bufinfo *bf = list_entry(pr->buffers.next,
@@ -622,7 +622,7 @@ static void blkid_probe_reset_buffer(blkid_probe pr)
free(bf);
}
- DBG(LOWPROBE, blkid_debug("buffers summary: %"PRIu64" bytes "
+ DBG(LOWPROBE, ul_debug("buffers summary: %"PRIu64" bytes "
"by %"PRIu64" read() call(s)",
len_ct, read_ct));
@@ -705,7 +705,7 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
else {
if (S_ISBLK(sb.st_mode)) {
if (blkdev_get_size(fd, (unsigned long long *) &pr->size)) {
- DBG(LOWPROBE, blkid_debug("failed to get device size"));
+ DBG(LOWPROBE, ul_debug("failed to get device size"));
goto err;
}
} else if (S_ISCHR(sb.st_mode))
@@ -732,15 +732,15 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
pr->flags |= BLKID_FL_CDROM_DEV;
#endif
- DBG(LOWPROBE, blkid_debug("ready for low-probing, offset=%jd, size=%jd",
+ DBG(LOWPROBE, ul_debug("ready for low-probing, offset=%jd, size=%jd",
pr->off, pr->size));
- DBG(LOWPROBE, blkid_debug("whole-disk: %s, regfile: %s",
+ DBG(LOWPROBE, ul_debug("whole-disk: %s, regfile: %s",
blkid_probe_is_wholedisk(pr) ?"YES" : "NO",
S_ISREG(pr->mode) ? "YES" : "NO"));
return 0;
err:
- DBG(LOWPROBE, blkid_debug("failed to prepare a device for low-probing"));
+ DBG(LOWPROBE, ul_debug("failed to prepare a device for low-probing"));
return -1;
}
@@ -762,7 +762,7 @@ int blkid_probe_set_dimension(blkid_probe pr,
if (!pr)
return -1;
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"changing probing area pr=%p: size=%llu, off=%llu "
"-to-> size=%llu, off=%llu",
pr,
@@ -816,7 +816,7 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
return -errno;
if (buf && !memcmp(mag->magic,
buf + (mag->sboff & 0x3ff), mag->len)) {
- DBG(LOWPROBE, blkid_debug("\tmagic sboff=%u, kboff=%ld",
+ DBG(LOWPROBE, ul_debug("\tmagic sboff=%u, kboff=%ld",
mag->sboff, mag->kboff));
if (offset)
*offset = off + (mag->sboff & 0x3ff);
@@ -837,7 +837,7 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
static inline void blkid_probe_start(blkid_probe pr)
{
if (pr) {
- DBG(LOWPROBE, blkid_debug("%p: start probe", pr));
+ DBG(LOWPROBE, ul_debug("%p: start probe", pr));
pr->cur_chain = NULL;
pr->prob_flags = 0;
blkid_probe_set_wiper(pr, 0, 0);
@@ -847,7 +847,7 @@ static inline void blkid_probe_start(blkid_probe pr)
static inline void blkid_probe_end(blkid_probe pr)
{
if (pr) {
- DBG(LOWPROBE, blkid_debug("%p: end probe", pr));
+ DBG(LOWPROBE, ul_debug("%p: end probe", pr));
pr->cur_chain = NULL;
pr->prob_flags = 0;
blkid_probe_set_wiper(pr, 0, 0);
@@ -931,7 +931,7 @@ int blkid_do_probe(blkid_probe pr)
chn->binary = FALSE; /* for sure... */
- DBG(LOWPROBE, blkid_debug("chain probe %s %s (idx=%d)",
+ DBG(LOWPROBE, ul_debug("chain probe %s %s (idx=%d)",
chn->driver->name,
chn->enabled? "ENABLED" : "DISABLED",
chn->idx));
@@ -1022,7 +1022,7 @@ int blkid_do_wipe(blkid_probe pr, int dryrun)
if (len > sizeof(buf))
len = sizeof(buf);
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"do_wipe [offset=0x%jx, len=%zd, chain=%s, idx=%d, dryrun=%s]\n",
offset, len, chn->driver->name, chn->idx, dryrun ? "yes" : "not"));
@@ -1106,7 +1106,7 @@ int blkid_probe_step_back(blkid_probe pr)
if (chn->idx >= 0) {
chn->idx--;
- DBG(LOWPROBE, blkid_debug("step back: moving %s chain index to %d",
+ DBG(LOWPROBE, ul_debug("step back: moving %s chain index to %d",
chn->driver->name,
chn->idx));
}
@@ -1118,7 +1118,7 @@ int blkid_probe_step_back(blkid_probe pr)
*/
size_t idx = chn->driver->id > 0 ? chn->driver->id - 1 : 0;
- DBG(LOWPROBE, blkid_debug("step back: moving to previous chain"));
+ DBG(LOWPROBE, ul_debug("step back: moving to previous chain"));
if (idx > 0)
pr->cur_chain = &pr->chains[idx];
@@ -1162,7 +1162,7 @@ int blkid_do_safeprobe(blkid_probe pr)
chn = pr->cur_chain = &pr->chains[i];
chn->binary = FALSE; /* for sure... */
- DBG(LOWPROBE, blkid_debug("chain safeprobe %s %s",
+ DBG(LOWPROBE, ul_debug("chain safeprobe %s %s",
chn->driver->name,
chn->enabled? "ENABLED" : "DISABLED"));
@@ -1216,7 +1216,7 @@ int blkid_do_fullprobe(blkid_probe pr)
chn = pr->cur_chain = &pr->chains[i];
chn->binary = FALSE; /* for sure... */
- DBG(LOWPROBE, blkid_debug("chain fullprobe %s: %s",
+ DBG(LOWPROBE, ul_debug("chain fullprobe %s: %s",
chn->driver->name,
chn->enabled? "ENABLED" : "DISABLED"));
@@ -1265,7 +1265,7 @@ struct blkid_prval *blkid_probe_assign_value(
v->chain = pr->cur_chain;
pr->nvals++;
- DBG(LOWPROBE, blkid_debug("assigning %s [%s]", name, v->chain->driver->name));
+ DBG(LOWPROBE, ul_debug("assigning %s [%s]", name, v->chain->driver->name));
return v;
}
@@ -1278,7 +1278,7 @@ int blkid_probe_reset_last_value(blkid_probe pr)
v = &pr->vals[pr->nvals - 1];
- DBG(LOWPROBE, blkid_debug("un-assigning %s [%s]", v->name, v->chain->driver->name));
+ DBG(LOWPROBE, ul_debug("un-assigning %s [%s]", v->name, v->chain->driver->name));
memset(v, 0, sizeof(struct blkid_prval));
pr->nvals--;
@@ -1375,7 +1375,7 @@ int blkid_probe_verify_csum(blkid_probe pr, uint64_t csum, uint64_t expected)
if (csum != expected) {
struct blkid_chain *chn = blkid_probe_get_chain(pr);
- DBG(LOWPROBE, blkid_debug(
+ DBG(LOWPROBE, ul_debug(
"incorrect checksum for type %s,"
" got %jX, expected %jX",
blkid_probe_get_probername(pr),
@@ -1474,7 +1474,7 @@ blkid_probe blkid_probe_get_wholedisk_probe(blkid_probe pr)
if (!disk_path)
return NULL;
- DBG(LOWPROBE, blkid_debug("allocate a wholedisk probe"));
+ DBG(LOWPROBE, ul_debug("allocate a wholedisk probe"));
pr->disk_probe = blkid_new_probe_from_filename(disk_path);
@@ -1599,7 +1599,7 @@ int blkid_probe_get_value(blkid_probe pr, int num, const char **name,
if (len)
*len = v->len;
- DBG(LOWPROBE, blkid_debug("returning %s value", v->name));
+ DBG(LOWPROBE, ul_debug("returning %s value", v->name));
return 0;
}
@@ -1662,7 +1662,7 @@ struct blkid_prval *__blkid_probe_lookup_value(blkid_probe pr, const char *name)
struct blkid_prval *v = &pr->vals[i];
if (v->name && strcmp(name, v->name) == 0) {
- DBG(LOWPROBE, blkid_debug("returning %s value", v->name));
+ DBG(LOWPROBE, ul_debug("returning %s value", v->name));
return v;
}
}
@@ -1772,7 +1772,7 @@ void blkid_probe_set_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
return;
if (!size) {
- DBG(LOWPROBE, blkid_debug("zeroize wiper"));
+ DBG(LOWPROBE, ul_debug("zeroize wiper"));
pr->wipe_size = pr->wipe_off = 0;
pr->wipe_chain = NULL;
return;
@@ -1789,7 +1789,7 @@ void blkid_probe_set_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
pr->wipe_chain = chn;
DBG(LOWPROBE,
- blkid_debug("wiper set to %s::%s off=%jd size=%jd",
+ ul_debug("wiper set to %s::%s off=%jd size=%jd",
chn->driver->name,
chn->driver->idinfos[chn->idx]->name,
pr->wipe_off, pr->wipe_size));
@@ -1822,7 +1822,7 @@ void blkid_probe_use_wiper(blkid_probe pr, blkid_loff_t off, blkid_loff_t size)
struct blkid_chain *chn = NULL;
if (blkid_probe_is_wiped(pr, &chn, off, size) && chn) {
- DBG(LOWPROBE, blkid_debug("previously wiped area modified "
+ DBG(LOWPROBE, ul_debug("previously wiped area modified "
" -- ignore previous results"));
blkid_probe_set_wiper(pr, 0, 0);
blkid_probe_chain_reset_vals(pr, chn);
diff --git a/libblkid/src/read.c b/libblkid/src/read.c
index 59ceb019e..0e91c9c22 100644
--- a/libblkid/src/read.c
+++ b/libblkid/src/read.c
@@ -150,7 +150,7 @@ static int parse_start(char **cp)
return 0;
if (!strncmp(p, "<device", 7)) {
- DBG(READ, blkid_debug("found device header: %8s", p));
+ DBG(READ, ul_debug("found device header: %8s", p));
p += 7;
*cp = p;
@@ -169,7 +169,7 @@ static int parse_end(char **cp)
*cp = skip_over_blank(*cp);
if (!strncmp(*cp, "</device>", 9)) {
- DBG(READ, blkid_debug("found device trailer %9s", *cp));
+ DBG(READ, ul_debug("found device trailer %9s", *cp));
*cp += 9;
return 0;
}
@@ -193,13 +193,13 @@ static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
start = tmp = strchr(*cp, '>');
if (!start) {
- DBG(READ, blkid_debug("blkid: short line parsing dev: %s", *cp));
+ DBG(READ, ul_debug("blkid: short line parsing dev: %s", *cp));
return -BLKID_ERR_CACHE;
}
start = skip_over_blank(start + 1);
end = skip_over_word(start);
- DBG(READ, blkid_debug("device should be %*s",
+ DBG(READ, ul_debug("device should be %*s",
(int)(end - start), start));
if (**cp == '>')
@@ -210,12 +210,12 @@ static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
*tmp = '\0';
if (!(tmp = strrchr(end, '<')) || parse_end(&tmp) < 0) {
- DBG(READ, blkid_debug("blkid: missing </device> ending: %s", end));
+ DBG(READ, ul_debug("blkid: missing </device> ending: %s", end));
} else if (tmp)
*tmp = '\0';
if (end - start <= 1) {
- DBG(READ, blkid_debug("blkid: empty device name: %s", *cp));
+ DBG(READ, ul_debug("blkid: empty device name: %s", *cp));
return -BLKID_ERR_CACHE;
}
@@ -223,7 +223,7 @@ static int parse_dev(blkid_cache cache, blkid_dev *dev, char **cp)
if (name == NULL)
return -BLKID_ERR_MEM;
- DBG(READ, blkid_debug("found dev %s", name));
+ DBG(READ, ul_debug("found dev %s", name));
if (!(*dev = blkid_get_dev(cache, name, BLKID_DEV_CREATE))) {
free(name);
@@ -254,7 +254,7 @@ static int parse_token(char **name, char **value, char **cp)
if (**value == '"') {
end = strchr(*value + 1, '"');
if (!end) {
- DBG(READ, blkid_debug("unbalanced quotes at: %s", *value));
+ DBG(READ, ul_debug("unbalanced quotes at: %s", *value));
*cp = *value;
return -BLKID_ERR_CACHE;
}
@@ -326,7 +326,7 @@ static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp)
} else
ret = blkid_set_tag(dev, name, value, strlen(value));
- DBG(READ, blkid_debug(" tag: %s=\"%s\"", name, value));
+ DBG(READ, ul_debug(" tag: %s=\"%s\"", name, value));
return ret < 0 ? ret : 1;
}
@@ -352,7 +352,7 @@ static int blkid_parse_line(blkid_cache cache, blkid_dev *dev_p, char *cp)
*dev_p = NULL;
- DBG(READ, blkid_debug("line: %s", cp));
+ DBG(READ, ul_debug("line: %s", cp));
if ((ret = parse_dev(cache, dev_p, &cp)) <= 0)
return ret;
@@ -364,7 +364,7 @@ static int blkid_parse_line(blkid_cache cache, blkid_dev *dev_p, char *cp)
}
if (dev->bid_type == NULL) {
- DBG(READ, blkid_debug("blkid: device %s has no TYPE",dev->bid_name));
+ DBG(READ, ul_debug("blkid: device %s has no TYPE",dev->bid_name));
blkid_free_dev(dev);
goto done;
}
@@ -400,12 +400,12 @@ void blkid_read_cache(blkid_cache cache)
goto errout;
if ((st.st_mtime == cache->bic_ftime) ||
(cache->bic_flags & BLKID_BIC_FL_CHANGED)) {
- DBG(CACHE, blkid_debug("skipping re-read of %s",
+ DBG(CACHE, ul_debug("skipping re-read of %s",
cache->bic_filename));
goto errout;
}
- DBG(CACHE, blkid_debug("reading cache file %s",
+ DBG(CACHE, ul_debug("reading cache file %s",
cache->bic_filename));
file = fdopen(fd, "r" UL_CLOEXECSTR);
@@ -428,7 +428,7 @@ void blkid_read_cache(blkid_cache cache)
}
if (blkid_parse_line(cache, &dev, buf) < 0) {
- DBG(READ, blkid_debug("blkid: bad format on line %d", lineno));
+ DBG(READ, ul_debug("blkid: bad format on line %d", lineno));
continue;
}
}
diff --git a/libblkid/src/resolve.c b/libblkid/src/resolve.c
index 3a93f53dc..ea5e407c4 100644
--- a/libblkid/src/resolve.c
+++ b/libblkid/src/resolve.c
@@ -32,7 +32,7 @@ char *blkid_get_tag_value(blkid_cache cache, const char *tagname,
blkid_cache c = cache;
char *ret = NULL;
- DBG(RESOLVE, blkid_debug("looking for %s on %s", tagname, devname));
+ DBG(RESOLVE, ul_debug("looking for %s on %s", tagname, devname));
if (!devname)
return NULL;
@@ -68,7 +68,7 @@ char *blkid_get_devname(blkid_cache cache, const char *token,
if (!cache && blkid_get_cache(&c, NULL) < 0)
return NULL;
- DBG(RESOLVE, blkid_debug("looking for %s%s%s %s", token, value ? "=" : "",
+ DBG(RESOLVE, ul_debug("looking for %s%s%s %s", token, value ? "=" : "",
value ? value : "", cache ? "in cache" : "from disk"));
if (!value) {
diff --git a/libblkid/src/save.c b/libblkid/src/save.c
index 424017a32..8216f0917 100644
--- a/libblkid/src/save.c
+++ b/libblkid/src/save.c
@@ -33,7 +33,7 @@ static int save_dev(blkid_dev dev, FILE *file)
if (!dev || dev->bid_name[0] != '/')
return 0;
- DBG(SAVE, blkid_debug("device %s, type %s", dev->bid_name, dev->bid_type ?
+ DBG(SAVE, ul_debug("device %s, type %s", dev->bid_name, dev->bid_type ?
dev->bid_type : "(null)"));
fprintf(file, "<device DEVNO=\"0x%04lx\" TIME=\"%ld.%ld\"",
@@ -70,7 +70,7 @@ int blkid_flush_cache(blkid_cache cache)
if (list_empty(&cache->bic_devs) ||
!(cache->bic_flags & BLKID_BIC_FL_CHANGED)) {
- DBG(SAVE, blkid_debug("skipping cache file write"));
+ DBG(SAVE, ul_debug("skipping cache file write"));
return 0;
}
@@ -89,7 +89,7 @@ int blkid_flush_cache(blkid_cache cache)
S_IRUSR|S_IRGRP|S_IROTH|
S_IXUSR|S_IXGRP|S_IXOTH) != 0
&& errno != EEXIST) {
- DBG(SAVE, blkid_debug("can't create %s directory for cache file",
+ DBG(SAVE, ul_debug("can't create %s directory for cache file",
BLKID_RUNTIME_DIR));
return 0;
}
@@ -98,7 +98,7 @@ int blkid_flush_cache(blkid_cache cache)
/* If we can't write to the cache file, then don't even try */
if (((ret = stat(filename, &st)) < 0 && errno != ENOENT) ||
(ret == 0 && access(filename, W_OK) < 0)) {
- DBG(SAVE, blkid_debug("can't write to cache file %s", filename));
+ DBG(SAVE, ul_debug("can't write to cache file %s", filename));
return 0;
}
@@ -116,7 +116,7 @@ int blkid_flush_cache(blkid_cache cache)
fd = mkostemp(tmp, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC);
if (fd >= 0) {
if (fchmod(fd, 0644) != 0)
- DBG(SAVE, blkid_debug("%s: fchmod failed", filename));
+ DBG(SAVE, ul_debug("%s: fchmod failed", filename));
else if ((file = fdopen(fd, "w" UL_CLOEXECSTR)))
opened = tmp;
if (!file)
@@ -130,7 +130,7 @@ int blkid_flush_cache(blkid_cache cache)
opened = filename;
}
- DBG(SAVE, blkid_debug("writing cache file %s (really %s)",
+ DBG(SAVE, ul_debug("writing cache file %s (really %s)",
filename, opened));
if (!file) {
@@ -152,12 +152,12 @@ int blkid_flush_cache(blkid_cache cache)
}
if (close_stream(file) != 0)
- DBG(SAVE, blkid_debug("write failed: %s", filename));
+ DBG(SAVE, ul_debug("write failed: %s", filename));
if (opened != filename) {
if (ret < 0) {
unlink(opened);
- DBG(SAVE, blkid_debug("unlinked temp cache %s", opened));
+ DBG(SAVE, ul_debug("unlinked temp cache %s", opened));
} else {
char *backup;
@@ -166,17 +166,17 @@ int blkid_flush_cache(blkid_cache cache)
sprintf(backup, "%s.old", filename);
unlink(backup);
if (link(filename, backup)) {
- DBG(SAVE, blkid_debug("can't link %s to %s",
+ DBG(SAVE, ul_debug("can't link %s to %s",
filename, backup));
}
free(backup);
}
if (rename(opened, filename)) {
ret = errno;
- DBG(SAVE, blkid_debug("can't rename %s to %s",
+ DBG(SAVE, ul_debug("can't rename %s to %s",
opened, filename));
} else {
- DBG(SAVE, blkid_debug("moved temp cache %s", opened));
+ DBG(SAVE, ul_debug("moved temp cache %s", opened));
}
}
}
diff --git a/libblkid/src/superblocks/ext.c b/libblkid/src/superblocks/ext.c
index 1de602214..5b1d179f3 100644
--- a/libblkid/src/superblocks/ext.c
+++ b/libblkid/src/superblocks/ext.c
@@ -165,7 +165,7 @@ static void ext_get_info(blkid_probe pr, int ver, struct ext2_super_block *es)
{
struct blkid_chain *chn = blkid_probe_get_chain(pr);
- DBG(PROBE, blkid_debug("ext2_sb.compat = %08X:%08X:%08X",
+ DBG(PROBE, ul_debug("ext2_sb.compat = %08X:%08X:%08X",
le32_to_cpu(es->s_feature_compat),
le32_to_cpu(es->s_feature_incompat),
le32_to_cpu(es->s_feature_ro_compat)));
diff --git a/libblkid/src/superblocks/minix.c b/libblkid/src/superblocks/minix.c
index 3e80e5b22..9ea49fee8 100644
--- a/libblkid/src/superblocks/minix.c
+++ b/libblkid/src/superblocks/minix.c
@@ -60,7 +60,7 @@ static int get_minix_version(const unsigned char *data, int *other_endian)
if (!version)
return -1;
- DBG(LOWPROBE, blkid_debug("minix version %d detected [%s]", version,
+ DBG(LOWPROBE, ul_debug("minix version %d detected [%s]", version,
#if defined(WORDS_BIGENDIAN)
*other_endian ? "LE" : "BE"
#else
diff --git a/libblkid/src/superblocks/nilfs.c b/libblkid/src/superblocks/nilfs.c
index 894dadf53..7b8771701 100644
--- a/libblkid/src/superblocks/nilfs.c
+++ b/libblkid/src/superblocks/nilfs.c
@@ -114,7 +114,7 @@ static int probe_nilfs2(blkid_probe pr, const struct blkid_idmag *mag)
le64_to_cpu(sbb->s_last_cno));
sb = swp ? sbb : sbp;
- DBG(LOWPROBE, blkid_debug("nilfs2: primary=%d, backup=%d, swap=%d",
+ DBG(LOWPROBE, ul_debug("nilfs2: primary=%d, backup=%d, swap=%d",
valid[0], valid[1], swp));
if (strlen(sb->s_volume_name))
diff --git a/libblkid/src/superblocks/ntfs.c b/libblkid/src/superblocks/ntfs.c
index 41eab26e9..8ff9ccda1 100644
--- a/libblkid/src/superblocks/ntfs.c
+++ b/libblkid/src/superblocks/ntfs.c
@@ -149,7 +149,7 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
off = le64_to_cpu(ns->mft_cluster_location) * sector_size *
sectors_per_cluster;
- DBG(LOWPROBE, blkid_debug("NTFS: sector_size=%d, mft_record_size=%d, "
+ DBG(LOWPROBE, ul_debug("NTFS: sector_size=%d, mft_record_size=%d, "
"sectors_per_cluster=%d, nr_clusters=%ju "
"cluster_offset=%jd",
(int) sector_size, mft_record_size,
diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c
index e576d95ff..17da89a3e 100644
--- a/libblkid/src/superblocks/superblocks.c
+++ b/libblkid/src/superblocks/superblocks.c
@@ -284,7 +284,7 @@ int blkid_probe_filter_superblocks_usage(blkid_probe pr, int flag, int usage)
} else if (flag & BLKID_FLTR_ONLYIN)
blkid_bmp_set_item(chn->fltr, i);
}
- DBG(LOWPROBE, blkid_debug("a new probing usage-filter initialized"));
+ DBG(LOWPROBE, ul_debug("a new probing usage-filter initialized"));
return 0;
}
@@ -341,7 +341,7 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
return -EINVAL;
blkid_probe_chain_reset_vals(pr, chn);
- DBG(LOWPROBE, blkid_debug("--> starting probing loop [SUBLKS idx=%d]",
+ DBG(LOWPROBE, ul_debug("--> starting probing loop [SUBLKS idx=%d]",
chn->idx));
if (pr->size <= 0 || (pr->size <= 1024 && !S_ISCHR(pr->mode)))
@@ -361,7 +361,7 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
id = idinfos[i];
if (chn->fltr && blkid_bmp_get_item(chn->fltr, i)) {
- DBG(LOWPROBE, blkid_debug("filter out: %s", id->name));
+ DBG(LOWPROBE, ul_debug("filter out: %s", id->name));
rc = BLKID_PROBE_NONE;
continue;
}
@@ -384,7 +384,7 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
continue;
}
- DBG(LOWPROBE, blkid_debug("[%zd] %s:", i, id->name));
+ DBG(LOWPROBE, ul_debug("[%zd] %s:", i, id->name));
rc = blkid_probe_get_idmag(pr, id, &off, &mag);
if (rc < 0)
@@ -394,7 +394,7 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
/* final check by probing function */
if (id->probefunc) {
- DBG(LOWPROBE, blkid_debug("\tcall probefunc()"));
+ DBG(LOWPROBE, ul_debug("\tcall probefunc()"));
rc = id->probefunc(pr, mag);
if (rc != BLKID_PROBE_OK) {
blkid_probe_chain_reset_vals(pr, chn);
@@ -418,17 +418,17 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
(unsigned char *) mag->magic);
if (rc) {
blkid_probe_chain_reset_vals(pr, chn);
- DBG(LOWPROBE, blkid_debug("failed to set result -- ingnore"));
+ DBG(LOWPROBE, ul_debug("failed to set result -- ingnore"));
continue;
}
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [SUBLKS idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (type=%s) [SUBLKS idx=%d]",
id->name, chn->idx));
return BLKID_PROBE_OK;
}
nothing:
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed=%d) [SUBLKS idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (failed=%d) [SUBLKS idx=%d]",
rc, chn->idx));
return rc;
}
@@ -481,7 +481,7 @@ static int superblocks_safeprobe(blkid_probe pr, struct blkid_chain *chn)
return rc; /* error */
if (count > 1 && intol) {
- DBG(LOWPROBE, blkid_debug("ERROR: superblocks chain: "
+ DBG(LOWPROBE, ul_debug("ERROR: superblocks chain: "
"ambivalent result detected (%d filesystems)!",
count));
return -2; /* error, ambivalent result (more FS) */
diff --git a/libblkid/src/superblocks/swap.c b/libblkid/src/superblocks/swap.c
index 3b5015631..3f21391c8 100644
--- a/libblkid/src/superblocks/swap.c
+++ b/libblkid/src/superblocks/swap.c
@@ -49,11 +49,11 @@ static int swap_set_info(blkid_probe pr, const char *version)
/* SWAPSPACE2 - check for wrong version or zeroed pagecount */
if (strcmp(version, "1") == 0) {
if (hdr->version != 1 && swab32(hdr->version) != 1) {
- DBG(LOWPROBE, blkid_debug("incorrect swap version"));
+ DBG(LOWPROBE, ul_debug("incorrect swap version"));
return 1;
}
if (hdr->lastpage == 0) {
- DBG(LOWPROBE, blkid_debug("not set last swap page"));
+ DBG(LOWPROBE, ul_debug("not set last swap page"));
return 1;
}
}
diff --git a/libblkid/src/superblocks/vfat.c b/libblkid/src/superblocks/vfat.c
index 6d7cda9ad..716a5ae6b 100644
--- a/libblkid/src/superblocks/vfat.c
+++ b/libblkid/src/superblocks/vfat.c
@@ -123,7 +123,7 @@ static unsigned char *search_fat_label(blkid_probe pr,
struct vfat_dir_entry *ent, *dir = NULL;
uint32_t i;
- DBG(LOWPROBE, blkid_debug("\tlook for label in root-dir "
+ DBG(LOWPROBE, ul_debug("\tlook for label in root-dir "
"(entries: %d, offset: %jd)", entries, offset));
if (!blkid_probe_is_tiny(pr)) {
@@ -162,7 +162,7 @@ static unsigned char *search_fat_label(blkid_probe pr,
if ((ent->attr & (FAT_ATTR_VOLUME_ID | FAT_ATTR_DIR)) ==
FAT_ATTR_VOLUME_ID) {
- DBG(LOWPROBE, blkid_debug("\tfound fs LABEL at entry %d", i));
+ DBG(LOWPROBE, ul_debug("\tfound fs LABEL at entry %d", i));
return ent->name;
}
}
diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c
index e095ab1be..6af806251 100644
--- a/libblkid/src/tag.c
+++ b/libblkid/src/tag.c
@@ -30,7 +30,6 @@ static blkid_tag blkid_new_tag(void)
return tag;
}
-#ifdef CONFIG_BLKID_DEBUG
void blkid_debug_dump_tag(blkid_tag tag)
{
if (!tag) {
@@ -40,14 +39,13 @@ void blkid_debug_dump_tag(blkid_tag tag)
fprintf(stderr, " tag: %s=\"%s\"\n", tag->bit_name, tag->bit_val);
}
-#endif
void blkid_free_tag(blkid_tag tag)
{
if (!tag)
return;
- DBG(TAG, blkid_debug(" freeing tag %s=%s", tag->bit_name,
+ DBG(TAG, ul_debug(" freeing tag %s=%s", tag->bit_name,
tag->bit_val ? tag->bit_val : "(NULL)"));
DBG(TAG, blkid_debug_dump_tag(tag));
@@ -109,7 +107,7 @@ static blkid_tag blkid_find_head_cache(blkid_cache cache, const char *type)
list_for_each(p, &cache->bic_tags) {
tmp = list_entry(p, struct blkid_struct_tag, bit_tags);
if (!strcmp(tmp->bit_name, type)) {
- DBG(TAG, blkid_debug(" found cache tag head %s", type));
+ DBG(TAG, ul_debug(" found cache tag head %s", type));
head = tmp;
break;
}
@@ -177,7 +175,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
if (!head)
goto errout;
- DBG(TAG, blkid_debug(" creating new cache tag head %s", name));
+ DBG(TAG, ul_debug(" creating new cache tag head %s", name));
head->bit_name = name ? strdup(name) : NULL;
if (!head->bit_name)
goto errout;
@@ -221,7 +219,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
{
char *name, *value, *cp;
- DBG(TAG, blkid_debug("trying to parse '%s' as a tag", token));
+ DBG(TAG, ul_debug("trying to parse '%s' as a tag", token));
if (!token || !(cp = strchr(token, '=')))
return -1;
@@ -253,7 +251,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
return 0;
errout:
- DBG(TAG, blkid_debug("parse error: '%s'", token));
+ DBG(TAG, ul_debug("parse error: '%s'", token));
free(name);
return -1;
}
@@ -350,7 +348,7 @@ blkid_dev blkid_find_dev_with_tag(blkid_cache cache,
blkid_read_cache(cache);
- DBG(TAG, blkid_debug("looking for %s=%s in cache", type, value));
+ DBG(TAG, ul_debug("looking for %s=%s in cache", type, value));
try_again:
pri = -1;
diff --git a/libblkid/src/topology/dm.c b/libblkid/src/topology/dm.c
index 42a2f2f7e..e061632ca 100644
--- a/libblkid/src/topology/dm.c
+++ b/libblkid/src/topology/dm.c
@@ -57,7 +57,7 @@ static int probe_dm_tp(blkid_probe pr,
if (!cmd)
goto nothing;
if (pipe(dmpipe) < 0) {
- DBG(LOWPROBE, blkid_debug("Failed to open pipe: errno=%d", errno));
+ DBG(LOWPROBE, ul_debug("Failed to open pipe: errno=%d", errno));
goto nothing;
}
@@ -91,11 +91,11 @@ static int probe_dm_tp(blkid_probe pr,
execv(dmargv[0], dmargv);
- DBG(LOWPROBE, blkid_debug("Failed to execute %s: errno=%d", cmd, errno));
+ DBG(LOWPROBE, ul_debug("Failed to execute %s: errno=%d", cmd, errno));
exit(1);
}
case -1:
- DBG(LOWPROBE, blkid_debug("Failed to forking: errno=%d", errno));
+ DBG(LOWPROBE, ul_debug("Failed to forking: errno=%d", errno));
goto nothing;
default:
break;
diff --git a/libblkid/src/topology/lvm.c b/libblkid/src/topology/lvm.c
index 71097a5a4..bd079d47b 100644
--- a/libblkid/src/topology/lvm.c
+++ b/libblkid/src/topology/lvm.c
@@ -67,7 +67,7 @@ static int probe_lvm_tp(blkid_probe pr,
goto nothing;
if (pipe(lvpipe) < 0) {
- DBG(LOWPROBE, blkid_debug("Failed to open pipe: errno=%d", errno));
+ DBG(LOWPROBE, ul_debug("Failed to open pipe: errno=%d", errno));
goto nothing;
}
@@ -94,11 +94,11 @@ static int probe_lvm_tp(blkid_probe pr,
execv(lvargv[0], lvargv);
- DBG(LOWPROBE, blkid_debug("Failed to execute %s: errno=%d", cmd, errno));
+ DBG(LOWPROBE, ul_debug("Failed to execute %s: errno=%d", cmd, errno));
exit(1);
}
case -1:
- DBG(LOWPROBE, blkid_debug("Failed to forking: errno=%d", errno));
+ DBG(LOWPROBE, ul_debug("Failed to forking: errno=%d", errno));
goto nothing;
default:
break;
diff --git a/libblkid/src/topology/topology.c b/libblkid/src/topology/topology.c
index 75cb7dd50..a6a7a3bd5 100644
--- a/libblkid/src/topology/topology.c
+++ b/libblkid/src/topology/topology.c
@@ -153,7 +153,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
return -1; /* nothing, works with block devices only */
if (chn->binary) {
- DBG(LOWPROBE, blkid_debug("initialize topology binary data"));
+ DBG(LOWPROBE, ul_debug("initialize topology binary data"));
if (chn->data)
/* reset binary data */
@@ -169,7 +169,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
blkid_probe_chain_reset_vals(pr, chn);
- DBG(LOWPROBE, blkid_debug("--> starting probing loop [TOPOLOGY idx=%d]",
+ DBG(LOWPROBE, ul_debug("--> starting probing loop [TOPOLOGY idx=%d]",
chn->idx));
i = chn->idx < 0 ? 0 : chn->idx + 1U;
@@ -180,7 +180,7 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
chn->idx = i;
if (id->probefunc) {
- DBG(LOWPROBE, blkid_debug("%s: call probefunc()", id->name));
+ DBG(LOWPROBE, ul_debug("%s: call probefunc()", id->name));
if (id->probefunc(pr, NULL) != 0)
continue;
}
@@ -191,12 +191,12 @@ static int topology_probe(blkid_probe pr, struct blkid_chain *chn)
/* generic for all probing drivers */
topology_set_logical_sector_size(pr);
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [TOPOLOGY idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (type=%s) [TOPOLOGY idx=%d]",
id->name, chn->idx));
return 0;
}
- DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed) [TOPOLOGY idx=%d]",
+ DBG(LOWPROBE, ul_debug("<-- leaving probing loop (failed) [TOPOLOGY idx=%d]",
chn->idx));
return 1;
}
diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c
index 1c0ca0f7d..d8ad79d68 100644
--- a/libblkid/src/verify.c
+++ b/libblkid/src/verify.c
@@ -71,13 +71,13 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
diff = now - dev->bid_time;
if (stat(dev->bid_name, &st) < 0) {
- DBG(PROBE, blkid_debug("blkid_verify: error %m (%d) while "
+ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while "
"trying to stat %s", errno,
dev->bid_name));
open_err:
if ((errno == EPERM) || (errno == EACCES) || (errno == ENOENT)) {
/* We don't have read permission, just return cache data. */
- DBG(PROBE, blkid_debug("returning unverified data for %s",
+ DBG(PROBE, ul_debug("returning unverified data for %s",
dev->bid_name));
return dev;
}
@@ -99,12 +99,12 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
return dev;
#ifndef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
- DBG(PROBE, blkid_debug("need to revalidate %s (cache time %lu, stat time %lu,\t"
+ DBG(PROBE, ul_debug("need to revalidate %s (cache time %lu, stat time %lu,\t"
"time since last check %lu)",
dev->bid_name, (unsigned long)dev->bid_time,
(unsigned long)st.st_mtime, (unsigned long)diff));
#else
- DBG(PROBE, blkid_debug("need to revalidate %s (cache time %lu.%lu, stat time %lu.%lu,\t"
+ DBG(PROBE, ul_debug("need to revalidate %s (cache time %lu.%lu, stat time %lu.%lu,\t"
"time since last check %lu)",
dev->bid_name,
(unsigned long)dev->bid_time, (unsigned long)dev->bid_utime,
@@ -122,7 +122,7 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
fd = open(dev->bid_name, O_RDONLY|O_CLOEXEC);
if (fd < 0) {
- DBG(PROBE, blkid_debug("blkid_verify: error %m (%d) while "
+ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while "
"opening %s", errno,
dev->bid_name));
goto open_err;
@@ -174,7 +174,7 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
blkid_probe_to_tags(cache->probe, dev);
- DBG(PROBE, blkid_debug("%s: devno 0x%04llx, type %s",
+ DBG(PROBE, ul_debug("%s: devno 0x%04llx, type %s",
dev->bid_name, (long long)st.st_rdev, dev->bid_type));
}