File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
drivers/staging/lustre/lustre/osc Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -370,12 +370,17 @@ static int osc_cache_too_much(struct client_obd *cli)
370
370
return lru_shrink_min (cli );
371
371
} else {
372
372
time64_t duration = ktime_get_real_seconds ();
373
+ long timediff ;
373
374
374
375
/* knock out pages by duration of no IO activity */
375
376
duration -= cli -> cl_lru_last_used ;
376
- duration >>= 6 ; /* approximately 1 minute */
377
- if (duration > 0 &&
378
- pages >= div64_s64 ((s64 )budget , duration ))
377
+ /*
378
+ * The difference shouldn't be more than 70 years
379
+ * so we can safely case to a long. Round to
380
+ * approximately 1 minute.
381
+ */
382
+ timediff = (long )(duration >> 6 );
383
+ if (timediff > 0 && pages >= budget / timediff )
379
384
return lru_shrink_min (cli );
380
385
}
381
386
return 0 ;
You can’t perform that action at this time.
0 commit comments