diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2012-02-15 11:33:53 +0000 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2012-02-15 11:33:53 +0000 |
commit | 2e8c7f297516c67e16aa4ea038638bd27ff53404 (patch) | |
tree | 48747e9d4950cff4138e93da0289290c7bd393f8 /libdm/libdm-common.h | |
parent | 55761e14af4c167f79e9d7d4f6cfa28bb84be51d (diff) | |
download | lvm2-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.h | 2 |
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); |