From: ericm Date: Wed, 2 Sep 2009 17:29:42 +0000 (+0000) Subject: branch: b1_8 X-Git-Tag: v1_8_2_01~1^2~142 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a175f5c8ba30ddaab917ef725235be72029cfc34;p=fs%2Flustre-release.git branch: b1_8 fix safe type conversion. b=20392 r=nathan r=wangdi --- diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 0b1c7b5..2a79d39 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -691,7 +691,7 @@ static int ptlrpc_at_add_timed(struct ptlrpc_request *req) LASSERT(list_empty(&req->rq_timed_list)); - index = req->rq_deadline % array->paa_size; + index = (unsigned long)req->rq_deadline % array->paa_size; if (array->paa_reqs_count[index] > 0) { /* latest rpcs will have the latest deadlines in the list, * so search backward. */ @@ -888,7 +888,7 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service *svc) server will take. Send early replies to everyone expiring soon. */ CFS_INIT_LIST_HEAD(&work_list); deadline = -1; - index = array->paa_deadline % array->paa_size; + index = (unsigned long)array->paa_deadline % array->paa_size; count = array->paa_count; while (count > 0) { count -= array->paa_reqs_count[index];