Skip to contentSkip to conversation

master - libdm: Add dm_udev_wait_immediate.

PATCH Alasdair Kergon 1 participant 1 message Apr 28, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=16019b518e287da19c87eb64229f5c3ca057cb05
Commit:        16019b518e287da19c87eb64229f5c3ca057cb05
Parent:        a2d2a61339b83de0d48ed6ed15e816773393c6b4
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Thu Apr 28 00:54:27 2016 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Thu Apr 28 00:54:27 2016 +0100

libdm: Add dm_udev_wait_immediate.

dm_udev_wait() waits inside the library. dm_udev_wait_immediate allows the caller to do other things if the cookie isn't yet ready to be decremented.

---
 WHATS_NEW_DM                        |    1 +
 libdm/.exported_symbols.DM_1_02_124 |    1 +
 libdm/libdevmapper.h                |    9 ++++++
 libdm/libdm-common.c                |   49 +++++++++++++++++++++++++++++++++-
 4 files changed, 58 insertions(+), 2 deletions(-)
WHATS_NEW_DM +1 -0
index 7460a94..b21d7d5 100644
@@ -1,5 +1,6 @@
 Version 1.02.124 - 
 ==================================
+  Add dm_udev_wait_immediate to libdevmapper for waiting outside the library.
 
 Version 1.02.123 - 23rd April 2016
 ==================================
libdm/.exported_symbols.DM_1_02_124 new file +1 -0
new file mode 100644
index 0000000..934011a
@@ -0,0 +1 @@
+dm_udev_wait_immediate
libdm/libdevmapper.h +9 -0
index a90013f..d2f40c9 100644
@@ -3218,6 +3218,15 @@ int dm_udev_create_cookie(uint32_t *cookie);
 int dm_udev_complete(uint32_t cookie);
 int dm_udev_wait(uint32_t cookie);
 
+/*
+ * dm_dev_wait_immediate 
+ * If *ready is 1 on return, the wait is complete.
+ * If *ready is 0 on return, the wait is incomplete and either
+ * this function or dm_udev_wait() must be called again.
+ * Returns 0 on error, when neither function should be called again.
+ */
+int dm_udev_wait_immediate(uint32_t cookie, int *ready);
+
 #define DM_DEV_DIR_UMASK 0022
 #define DM_CONTROL_NODE_UMASK 0177
 
libdm/libdm-common.c +47 -2

80 lines not on this page · raw message