Whamcloud - gitweb
Ratelimit a memory allocation failure message that can be too chatty.
[fs/lustre-release.git] / libcfs / libcfs / user-lock.c
index b01319f..cee36d7 100644 (file)
@@ -82,12 +82,6 @@ void spin_lock(spinlock_t *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;
@@ -153,6 +147,13 @@ void __up(struct semaphore *s)
  * - 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);
@@ -170,11 +171,23 @@ void complete(struct completion *c)
 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);
+        do {
+                if (wait_handler) 
+                        wait_handler(1000);
+                else
+                        break;
+        } while (c->done == 0);
         return 0;
 }
 
@@ -233,6 +246,12 @@ void up_write(struct rw_semaphore *s)
         (void)s;
 }
 
+void fini_rwsem(struct rw_semaphore *s)
+{
+        LASSERT(s != NULL);
+        (void)s;
+}
+
 #ifdef HAVE_LIBPTHREAD
 
 /*