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
Branch HEAD
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
user-lock.c
diff --git
a/libcfs/libcfs/user-lock.c
b/libcfs/libcfs/user-lock.c
index
f0f7fb7
..
0a3471a
100644
(file)
--- a/
libcfs/libcfs/user-lock.c
+++ b/
libcfs/libcfs/user-lock.c
@@
-16,8
+16,8
@@
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
[sun.com URL with a
- *
copy of GPLv2].
+ * version 2 along with this program; If not, see
+ *
http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
@@
-61,6
+61,7
@@
*
* - spin_lock_init(x)
* - spin_lock(x)
*
* - spin_lock_init(x)
* - spin_lock(x)
+ * - spin_lock_nested(x, subclass)
* - spin_unlock(x)
* - spin_trylock(x)
*
* - spin_unlock(x)
* - spin_trylock(x)
*
@@
-146,6
+147,20
@@
void __up(struct semaphore *s)
* - wait_for_completion(c)
*/
* - wait_for_completion(c)
*/
+static cfs_wait_handler_t wait_handler;
+
+void init_completion_module(cfs_wait_handler_t 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);
@@
-163,6
+178,20
@@
void complete(struct completion *c)
void wait_for_completion(struct completion *c)
{
LASSERT(c != NULL);
void wait_for_completion(struct completion *c)
{
LASSERT(c != NULL);
+ do {
+ if (call_wait_handler(1000) < 0)
+ break;
+ } while (c->done == 0);
+}
+
+int wait_for_completion_interruptible(struct completion *c)
+{
+ LASSERT(c != NULL);
+ do {
+ if (call_wait_handler(1000) < 0)
+ break;
+ } while (c->done == 0);
+ return 0;
}
/*
}
/*
@@
-220,6
+249,12
@@
void up_write(struct rw_semaphore *s)
(void)s;
}
(void)s;
}
+void fini_rwsem(struct rw_semaphore *s)
+{
+ LASSERT(s != NULL);
+ (void)s;
+}
+
#ifdef HAVE_LIBPTHREAD
/*
#ifdef HAVE_LIBPTHREAD
/*