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
Ratelimit a memory allocation failure message that can be too chatty.
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
user-lock.c
diff --git
a/libcfs/libcfs/user-lock.c
b/libcfs/libcfs/user-lock.c
index
b01319f
..
cee36d7
100644
(file)
--- a/
libcfs/libcfs/user-lock.c
+++ b/
libcfs/libcfs/user-lock.c
@@
-82,12
+82,6
@@
void spin_lock(spinlock_t *lock)
(void)lock;
}
(void)lock;
}
-void spin_lock_nested(spinlock_t *lock, unsigned int subclass)
-{
- (void)lock;
- (void)subclass;
-}
-
void spin_unlock(spinlock_t *lock)
{
(void)lock;
void spin_unlock(spinlock_t *lock)
{
(void)lock;
@@
-153,6
+147,13
@@
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;
+}
+
void init_completion(struct completion *c)
{
LASSERT(c != NULL);
void init_completion(struct completion *c)
{
LASSERT(c != NULL);
@@
-170,11
+171,23
@@
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 (wait_handler)
+ wait_handler(1000);
+ else
+ break;
+ } while (c->done == 0);
}
int wait_for_completion_interruptible(struct completion *c)
{
LASSERT(c != NULL);
}
int wait_for_completion_interruptible(struct completion *c)
{
LASSERT(c != NULL);
+ do {
+ if (wait_handler)
+ wait_handler(1000);
+ else
+ break;
+ } while (c->done == 0);
return 0;
}
return 0;
}
@@
-233,6
+246,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
/*