Commit a2791d3a authored by Trond Myklebust's avatar Trond Myklebust

pNFS: Don't zero out the array in nfs4_alloc_pages()

We don't need a zeroed out array, since it is immediately being filled.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent ec846469
...@@ -965,7 +965,7 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags) ...@@ -965,7 +965,7 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags)
struct page **pages; struct page **pages;
int i; int i;
pages = kcalloc(size, sizeof(struct page *), gfp_flags); pages = kmalloc_array(size, sizeof(struct page *), gfp_flags);
if (!pages) { if (!pages) {
dprintk("%s: can't alloc array of %zu pages\n", __func__, size); dprintk("%s: can't alloc array of %zu pages\n", __func__, size);
return NULL; return NULL;
...@@ -975,7 +975,7 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags) ...@@ -975,7 +975,7 @@ static struct page **nfs4_alloc_pages(size_t size, gfp_t gfp_flags)
pages[i] = alloc_page(gfp_flags); pages[i] = alloc_page(gfp_flags);
if (!pages[i]) { if (!pages[i]) {
dprintk("%s: failed to allocate page\n", __func__); dprintk("%s: failed to allocate page\n", __func__);
nfs4_free_pages(pages, size); nfs4_free_pages(pages, i);
return NULL; return NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment