From: Karel Zak Date: Thu, 29 Sep 2011 21:29:46 +0000 (+0200) Subject: libmount: use loopdev debug facility X-Git-Tag: v2.21-rc1~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=365e5a7c54d6684d03bc92e82202da68bab345a9;p=thirdparty%2Futil-linux.git libmount: use loopdev debug facility Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_loopdev.c b/libmount/src/context_loopdev.c index 084f08fa44..377dd769e8 100644 --- a/libmount/src/context_loopdev.c +++ b/libmount/src/context_loopdev.c @@ -86,8 +86,11 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt) DBG(CXT, mnt_debug_h(cxt, "enabling READ-ONLY flag")); lo_flags |= LO_FLAGS_READ_ONLY; } + loopcxt_init(&lc, 0); + ON_DBG(CXT, loopcxt_enable_debug(&lc, 1)); + optstr = mnt_fs_get_user_options(cxt->fs); /* diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 92d0b26a50..cce4c5c354 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -53,12 +53,18 @@ # include # include -# define DBG(m,x) do { \ - if ((MNT_DEBUG_ ## m) & libmount_debug_mask) {\ +# define ON_DBG(m, x) do { \ + if ((MNT_DEBUG_ ## m) & libmount_debug_mask) { \ + x; \ + } \ + } while (0) + +# define DBG(m, x) do { \ + if ((MNT_DEBUG_ ## m) & libmount_debug_mask) { \ fprintf(stderr, "libmount: %8s: ", # m); \ x; \ } \ - } while(0) + } while (0) # define DBG_FLUSH do { fflush(stderr); } while(0) @@ -87,7 +93,8 @@ mnt_debug_h(void *handler, const char *mesg, ...) } #else /* !CONFIG_LIBMOUNT_DEBUG */ -# define DBG(m,x) do { ; } while(0) +# define ON_DBG(m,x) do { ; } while (0) +# define DBG(m,x) do { ; } while (0) # define DBG_FLUSH do { ; } while(0) #endif