Whamcloud - gitweb
b=17491
authorzhanghc <zhanghc>
Wed, 8 Apr 2009 13:08:26 +0000 (13:08 +0000)
committerzhanghc <zhanghc>
Wed, 8 Apr 2009 13:08:26 +0000 (13:08 +0000)
eliminate "wrpped times" stuff in original patch

i=nathan.rutman
i=robert.read

lustre/ptlrpc/service.c

index e5b92b8..6ce3020 100644 (file)
@@ -681,7 +681,7 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
         struct ptlrpc_service *svc = req->rq_rqbd->rqbd_service;
         struct ptlrpc_request *rq = NULL;
         struct ptlrpc_at_array *array = &svc->srv_at_array;
-        __u32 index, wtimes;
+        __u32 index;
         int found = 0;
 
         if (AT_OFF)
@@ -699,13 +699,8 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
 
         LASSERT(list_empty(&req->rq_timed_list));
 
-        wtimes = req->rq_deadline / array->paa_size;
         index = req->rq_deadline % array->paa_size;
-        if (array->paa_reqs_count[index] > 0)
-                rq = list_entry(array->paa_reqs_array[index].next, 
-                                struct ptlrpc_request, rq_timed_list);
-
-        if (rq != NULL && (rq->rq_deadline / array->paa_size) < wtimes) {
+        if (array->paa_reqs_count[index] > 0) {
                 /* latest rpcs will have the latest deadlines in the list,
                  * so search backward. */
                 list_for_each_entry_reverse(rq, &array->paa_reqs_array[index], 
@@ -716,13 +711,11 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req)
                                 break;
                         }
                 }
-
-                /* AT array is corrupted? */
-                LASSERT(!list_empty(&req->rq_timed_list));
-        } else {
-                /* Add the request at the head of the list */
-                list_add(&req->rq_timed_list, &array->paa_reqs_array[index]);
         }
+        
+        /* Add the request at the head of the list */
+        if (list_empty(&req->rq_timed_list))
+                list_add(&req->rq_timed_list, &array->paa_reqs_array[index]);
 
         req->rq_at_linked = 1;
         req->rq_at_index = index;