summaryrefslogtreecommitdiffstats
path: root/libdm/libdm-common.h
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-02-15 11:33:53 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2012-02-15 11:33:53 +0000
commit2e8c7f297516c67e16aa4ea038638bd27ff53404 (patch)
tree48747e9d4950cff4138e93da0289290c7bd393f8 /libdm/libdm-common.h
parent55761e14af4c167f79e9d7d4f6cfa28bb84be51d (diff)
downloadlvm2-2e8c7f297516c67e16aa4ea038638bd27ff53404.tar.gz
lvm2-2e8c7f297516c67e16aa4ea038638bd27ff53404.tar.xz
lvm2-2e8c7f297516c67e16aa4ea038638bd27ff53404.zip
Add DEV_NAME macro.
Use the DEV_NAME macro to use the mangled form of the name if present, use normal name otherwise (we store both forms - mangled and unmangled in struct dm_task). Mangled form should be always preferred over unmangled with the exception of the situations where we divide one task into several others (like "create and load") - we need to avoid mangling the name twice (because of multiple dm_task_set_name calls)!
Diffstat (limited to 'libdm/libdm-common.h')
-rw-r--r--libdm/libdm-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdm/libdm-common.h b/libdm/libdm-common.h
index 1e290a2a..31151af7 100644
--- a/libdm/libdm-common.h
+++ b/libdm/libdm-common.h
@@ -18,6 +18,8 @@
#include "libdevmapper.h"
+#define DEV_NAME(dmt) (dmt->mangled_dev_name ? : dmt->dev_name)
+
int mangle_name(const char *str, size_t len, char *buf,
size_t buf_len, dm_string_mangling_t mode);