aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dm-log-userspace.h
diff options
context:
space:
mode:
authorJonathan E Brassow <jbrassow@redhat.com>2011-10-31 16:21:24 -0400
committerAlasdair G Kergon <agk@redhat.com>2011-10-31 16:21:24 -0400
commit5a25f0eb707bbb4a5aaaf19c933605a6dbaf77a5 (patch)
tree62f9af5013d252b0fdff5449b3adcaeadfff31aa /include/linux/dm-log-userspace.h
parentb89544575d0096735edc9b0ad187e635487905ad (diff)
dm log userspace: add log device dependency
Allow userspace dm log implementations to register their log device so it is no longer missing from the list of device dependencies. When device mapper targets use a device they normally call dm_get_device which includes it in the device list returned to userspace applications such as LVM through the DM_TABLE_DEPS ioctl. Userspace log devices don't use dm_get_device as userspace opens them so they are missing from the list of dependencies. This patch extends the DM_ULOG_CTR operation to allow userspace to respond with the name of the log device (if appropriate) to be registered via 'dm_get_device'. DM_ULOG_REQUEST_VERSION is incremented. This is backwards compatible. If the kernel and userspace log server have both been updated, the new information will be passed down to the kernel and the device will be registered. If the kernel is new, but the log server is old, the log server will not pass down any device information and the kernel will simply bypass the device registration as before. If the kernel is old but the log server is new, the log server will see the old version number and not pass the device info. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'include/linux/dm-log-userspace.h')
-rw-r--r--include/linux/dm-log-userspace.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
index eeace7d3ff1..0678c2adc42 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/linux/dm-log-userspace.h
@@ -52,15 +52,20 @@
52 * Payload-to-userspace: 52 * Payload-to-userspace:
53 * A single string containing all the argv arguments separated by ' 's 53 * A single string containing all the argv arguments separated by ' 's
54 * Payload-to-kernel: 54 * Payload-to-kernel:
55 * None. ('data_size' in the dm_ulog_request struct should be 0.) 55 * A NUL-terminated string that is the name of the device that is used
56 * as the backing store for the log data. 'dm_get_device' will be called
57 * on this device. ('dm_put_device' will be called on this device
58 * automatically after calling DM_ULOG_DTR.) If there is no device needed
59 * for log data, 'data_size' in the dm_ulog_request struct should be 0.
56 * 60 *
57 * The UUID contained in the dm_ulog_request structure is the reference that 61 * The UUID contained in the dm_ulog_request structure is the reference that
58 * will be used by all request types to a specific log. The constructor must 62 * will be used by all request types to a specific log. The constructor must
59 * record this assotiation with instance created. 63 * record this association with the instance created.
60 * 64 *
61 * When the request has been processed, user-space must return the 65 * When the request has been processed, user-space must return the
62 * dm_ulog_request to the kernel - setting the 'error' field and 66 * dm_ulog_request to the kernel - setting the 'error' field, filling the
63 * 'data_size' appropriately. 67 * data field with the log device if necessary, and setting 'data_size'
68 * appropriately.
64 */ 69 */
65#define DM_ULOG_CTR 1 70#define DM_ULOG_CTR 1
66 71
@@ -377,8 +382,11 @@
377 * dm_ulog_request or a change in the way requests are 382 * dm_ulog_request or a change in the way requests are
378 * issued/handled. Changes are outlined here: 383 * issued/handled. Changes are outlined here:
379 * version 1: Initial implementation 384 * version 1: Initial implementation
385 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via
387 * 'dm_get_device'.
380 */ 388 */
381#define DM_ULOG_REQUEST_VERSION 1 389#define DM_ULOG_REQUEST_VERSION 2
382 390
383struct dm_ulog_request { 391struct dm_ulog_request {
384 /* 392 /*