size_t nallocs;
int refcount;
int probe_sb_extra; /* extra BLKID_SUBLKS_* flags */
+ bool noprobe; /* disable libblkid device probing */
/* blkid_evaluate_tag() works in two ways:
*
return 0;
}
+void mnt_cache_enable_noprobe(struct libmnt_cache *cache, int enable)
+{
+ if (cache)
+ cache->noprobe = !!enable;
+}
+
/* note that the @key could be the same pointer as @value */
static int cache_add_entry(struct libmnt_cache *cache, char *key,
char *value, int flag)
assert(cache);
assert(devname);
+ if (cache->noprobe) {
+ DBG_OBJ(CACHE, cache, ul_debug("%s: skip blkid probe (noprobe)", devname));
+ return 1;
+ }
+
DBG_OBJ(CACHE, cache, ul_debug("%s: reading from blkid", devname));
pr = blkid_new_probe_from_filename(devname);
{
char *p = NULL;
- /*DBG_OBJ(CACHE, cache, ul_debug("resolving tag token=%s value=%s",
- token, value));*/
-
if (!token || !value)
return NULL;
p = (char *) cache_find_tag(cache, token, value);
if (!p) {
+ DBG_OBJ(CACHE, cache, ul_debug("evaluating (by blkid) tag %s=%s", token, value));
+
/* returns newly allocated string */
- p = blkid_evaluate_tag(token, value, cache ? &cache->bc : NULL);
+ p = blkid_evaluate_tag2(token, value,
+ cache ? &cache->bc : NULL,
+ cache && cache->noprobe ? BLKID_EVALUATE_NOPROBE : 0);
if (p && cache &&
cache_add_tag(cache, token, value, p, 0))
goto error;
}
+ DBG_OBJ(CACHE, cache, ul_debug("resolve tag %s=%s -> %s",
+ token, value, p ? p : "NOT FOUND"));
return p;
error:
free(p);
extern int mnt_context_merge_mflags(struct libmnt_context *cxt);
extern int mnt_context_update_tabs(struct libmnt_context *cxt);
+extern void mnt_cache_enable_noprobe(struct libmnt_cache *cache, int enable);
+
extern int mnt_context_umount_setopt(struct libmnt_context *cxt, int c, char *arg);
extern int mnt_context_mount_setopt(struct libmnt_context *cxt, int c, char *arg);