Whamcloud - gitweb
LU-2613 recovery: free open/close request promptly
[fs/lustre-release.git] / lustre / include / lustre_import.h
index 98c2c92..3beccba 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -180,6 +180,17 @@ struct obd_import {
         cfs_list_t                imp_delayed_list;
         /** @} */
 
+       /**
+        * List of requests that are retained for committed open replay. Once
+        * open is committed, open replay request will be moved from the
+        * imp_replay_list into the imp_committed_list.
+        * The imp_replay_cursor is for accelerating searching during replay.
+        * @{
+        */
+       cfs_list_t                imp_committed_list;
+       cfs_list_t               *imp_replay_cursor;
+       /** @} */
+
         /** obd device for this import */
         struct obd_device        *imp_obd;
 
@@ -192,8 +203,8 @@ struct obd_import {
         cfs_time_t                imp_sec_expire;
         /** @} */
 
-        /** Wait queue for those who need to wait for recovery completion */
-        cfs_waitq_t               imp_recovery_waitq;
+       /** Wait queue for those who need to wait for recovery completion */
+       wait_queue_head_t         imp_recovery_waitq;
 
         /** Number of requests currently in-flight */
         cfs_atomic_t              imp_inflight;
@@ -336,9 +347,11 @@ static inline unsigned int at_timeout2est(unsigned int val)
 }
 
 static inline void at_reset(struct adaptive_timeout *at, int val) {
+       spin_lock(&at->at_lock);
         at->at_current = val;
         at->at_worst_ever = val;
         at->at_worst_time = cfs_time_current_sec();
+       spin_unlock(&at->at_lock);
 }
 static inline void at_init(struct adaptive_timeout *at, int val, int flags) {
        memset(at, 0, sizeof(*at));