]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: more robust tab filter usage
authorKarel Zak <kzak@redhat.com>
Thu, 15 Nov 2012 14:35:24 +0000 (15:35 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Nov 2012 14:35:24 +0000 (15:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/tab_parse.c

index 97cba72a3333a9b57d0685ca64982a2d8b570cb1..fd7492d6afccb89f7c148ef6bc81211869977658 100644 (file)
@@ -153,6 +153,7 @@ int mnt_reset_context(struct libmnt_context *cxt)
        cxt->flags = MNT_FL_DEFAULT;
 
        mnt_context_reset_status(cxt);
+       mnt_context_set_tabfilter(cxt, NULL, NULL);
 
        /* restore non-resetable flags */
        cxt->flags |= (fl & MNT_FL_EXTERN_FSTAB);
@@ -938,6 +939,9 @@ int mnt_context_get_mtab(struct libmnt_context *cxt, struct libmnt_table **tb)
 
        if (tb)
                *tb = cxt->mtab;
+
+       DBG(CXT, mnt_debug_h(cxt, "mtab requested [nents=%d]",
+                               mnt_table_get_nents(cxt->mtab)));
        return 0;
 }
 
@@ -960,6 +964,7 @@ int mnt_context_set_tabfilter(struct libmnt_context *cxt,
                                cxt->table_fltrcb,
                                cxt->table_fltrcb_data);
 
+       DBG(CXT, mnt_debug_h(cxt, "tabfiler %s", fltr ? "ENABLED!" : "disabled"));
        return 0;
 }
 
index ad88320640acbcf9de8b40ea21f96a611cc26f6c..8a9d7349e199e339d88e7c7880bdfa231aa8ee1e 100644 (file)
@@ -508,8 +508,9 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
        assert(f);
        assert(filename);
 
-       DBG(TAB, mnt_debug_h(tb, "%s: start parsing (%d entries)",
-                               filename, mnt_table_get_nents(tb)));
+       DBG(TAB, mnt_debug_h(tb, "%s: start parsing [entries=%d, filter=%s]",
+                               filename, mnt_table_get_nents(tb),
+                               tb->fltrcb ? "yes" : "not"));
 
        /* necessary for /proc/mounts only, the /proc/self/mountinfo
         * parser sets the flag properly