From a531477a7f7233a312ce5ef84b4ea7db3f8a9a59 Mon Sep 17 00:00:00 2001 From: zhanghc Date: Wed, 8 Apr 2009 17:20:51 +0000 Subject: [PATCH] b=17491 remove "wrapped times" stuff in original patch i=nathan.rutman i=robert.read --- lustre/ptlrpc/service.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index fd7c38f..35a2eb4 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -848,7 +848,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) @@ -869,13 +869,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], @@ -886,13 +881,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; -- 1.8.3.1