Whamcloud - gitweb
LU-6447 mdt: mdt_identity_upcall to not block with rwlock held
[fs/lustre-release.git] / lustre / obdclass / upcall_cache.c
index 4d9ef1c..0e350ab 100644 (file)
@@ -221,13 +221,12 @@ find_again:
                              MAX_SCHEDULE_TIMEOUT;
                long left;
 
-               init_waitqueue_entry_current(&wait);
+               init_waitqueue_entry(&wait, current);
                add_wait_queue(&entry->ue_waitq, &wait);
                set_current_state(TASK_INTERRUPTIBLE);
                spin_unlock(&cache->uc_lock);
 
-               left = waitq_timedwait(&wait, TASK_INTERRUPTIBLE,
-                                          expiry);
+               left = schedule_timeout(expiry);
 
                spin_lock(&cache->uc_lock);
                remove_wait_queue(&entry->ue_waitq, &wait);
@@ -429,7 +428,7 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
                RETURN(ERR_PTR(-ENOMEM));
 
        spin_lock_init(&cache->uc_lock);
-       rwlock_init(&cache->uc_upcall_rwlock);
+       init_rwsem(&cache->uc_upcall_rwsem);
        for (i = 0; i < UC_CACHE_HASH_SIZE; i++)
                INIT_LIST_HEAD(&cache->uc_hashtable[i]);
        strlcpy(cache->uc_name, name, sizeof(cache->uc_name));