Fix incorrect page count calculation with large PAGE_SIZE
e.g., PAGE_SIZE 65536, cache line 8k. fix https://github.com/Open-CAS/open-cas-linux/issues/1015 Signed-off-by: Sun Feng <loyou85@gmail.com>
This commit is contained in:
parent
60218759d2
commit
7f82ef3048
@ -51,7 +51,7 @@ static struct ocf_request *_ocf_cleaner_alloc_req(struct ocf_cache *cache,
|
|||||||
|
|
||||||
/* Allocate pages for cleaning IO */
|
/* Allocate pages for cleaning IO */
|
||||||
req->data = ctx_data_alloc(cache->owner,
|
req->data = ctx_data_alloc(cache->owner,
|
||||||
ocf_line_size(cache) / PAGE_SIZE * count);
|
OCF_DIV_ROUND_UP((uint64_t)count * ocf_line_size(cache), PAGE_SIZE));
|
||||||
if (!req->data) {
|
if (!req->data) {
|
||||||
ocf_req_put(req);
|
ocf_req_put(req);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user