Whamcloud - gitweb
LU-4788 lfsck: replace cfs_list_t with list_head
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index f0f94d4..99b21dc 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
+#include <libcfs/libcfs.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
@@ -758,17 +754,9 @@ void target_client_add_cb(struct obd_device *obd, __u64 transno, void *cb_data,
 }
 EXPORT_SYMBOL(target_client_add_cb);
 
-#ifdef __KERNEL__
 static void
 check_and_start_recovery_timer(struct obd_device *obd,
                                struct ptlrpc_request *req, int new_client);
-#else
-static inline void
-check_and_start_recovery_timer(struct obd_device *obd,
-                               struct ptlrpc_request *req, int new_client)
-{
-}
-#endif
 
 int target_handle_connect(struct ptlrpc_request *req)
 {
@@ -1072,7 +1060,7 @@ dont_check_exports:
         if (rc)
                 GOTO(out, rc);
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 52, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 6, 53, 0)
        /* 2.2.0 clients always swab nidtbl entries due to a bug, so server
         * will do the swabbing for if the client is using the same endianness.
         *
@@ -1082,8 +1070,6 @@ dont_check_exports:
         * will never do MNE swabbing, let the client handle that.  LU-1644 */
        export->exp_need_mne_swab = !ptlrpc_req_need_swab(req) &&
                        !(data->ocd_connect_flags & OBD_CONNECT_MNE_SWAB);
-#else
-#warning "LU-1644: Remove old OBD_CONNECT_MNE_SWAB fixup and exp_need_mne_swab"
 #endif
 
         LASSERT(target->u.obt.obt_magic == OBT_MAGIC);
@@ -1382,7 +1368,6 @@ static void target_exp_dequeue_req_replay(struct ptlrpc_request *req)
        spin_unlock(&req->rq_export->exp_lock);
 }
 
-#ifdef __KERNEL__
 static void target_finish_recovery(struct obd_device *obd)
 {
         ENTRY;
@@ -2061,7 +2046,11 @@ static int target_recovery_thread(void *arg)
                          libcfs_nid2str(req->rq_peer.nid));
                 handle_recovery_req(thread, req,
                                     trd->trd_recovery_handler);
-                target_request_copy_put(req);
+               /* Because the waiting client can not send ping to server,
+                * so we need refresh the last_request_time, to avoid the
+                * export is being evicted */
+               ptlrpc_update_export_timer(req->rq_export, 0);
+               target_request_copy_put(req);
         }
 
        delta = (jiffies - delta) / HZ;
@@ -2167,7 +2156,6 @@ void target_recovery_init(struct lu_target *lut, svc_handler_t handler)
 }
 EXPORT_SYMBOL(target_recovery_init);
 
-#endif /* __KERNEL__ */
 
 static int target_process_req_flags(struct obd_device *obd,
                                     struct ptlrpc_request *req)