Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=20722 Fix watchdog timer messages to be more clear.
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
user-lock.c
diff --git
a/libcfs/libcfs/user-lock.c
b/libcfs/libcfs/user-lock.c
index
d36a17b
..
0a3471a
100644
(file)
--- a/
libcfs/libcfs/user-lock.c
+++ b/
libcfs/libcfs/user-lock.c
@@
-154,6
+154,13
@@
void init_completion_module(cfs_wait_handler_t handler)
wait_handler = handler;
}
wait_handler = handler;
}
+int call_wait_handler(int timeout)
+{
+ if (!wait_handler)
+ return -ENOSYS;
+ return wait_handler(timeout);
+}
+
void init_completion(struct completion *c)
{
LASSERT(c != NULL);
void init_completion(struct completion *c)
{
LASSERT(c != NULL);
@@
-172,9
+179,7
@@
void wait_for_completion(struct completion *c)
{
LASSERT(c != NULL);
do {
{
LASSERT(c != NULL);
do {
- if (wait_handler)
- wait_handler(1000);
- else
+ if (call_wait_handler(1000) < 0)
break;
} while (c->done == 0);
}
break;
} while (c->done == 0);
}
@@
-183,9
+188,7
@@
int wait_for_completion_interruptible(struct completion *c)
{
LASSERT(c != NULL);
do {
{
LASSERT(c != NULL);
do {
- if (wait_handler)
- wait_handler(1000);
- else
+ if (call_wait_handler(1000) < 0)
break;
} while (c->done == 0);
return 0;
break;
} while (c->done == 0);
return 0;