diff options
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index f69d95aa78b2..fd7ac5e841c1 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -154,6 +154,7 @@ static struct nfs_direct_req *nfs_direct_read_alloc(size_t nbytes, unsigned int | |||
154 | struct list_head *list; | 154 | struct list_head *list; |
155 | struct nfs_direct_req *dreq; | 155 | struct nfs_direct_req *dreq; |
156 | unsigned int reads = 0; | 156 | unsigned int reads = 0; |
157 | unsigned int rpages = (rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | ||
157 | 158 | ||
158 | dreq = kmem_cache_alloc(nfs_direct_cachep, SLAB_KERNEL); | 159 | dreq = kmem_cache_alloc(nfs_direct_cachep, SLAB_KERNEL); |
159 | if (!dreq) | 160 | if (!dreq) |
@@ -167,7 +168,7 @@ static struct nfs_direct_req *nfs_direct_read_alloc(size_t nbytes, unsigned int | |||
167 | 168 | ||
168 | list = &dreq->list; | 169 | list = &dreq->list; |
169 | for(;;) { | 170 | for(;;) { |
170 | struct nfs_read_data *data = nfs_readdata_alloc(); | 171 | struct nfs_read_data *data = nfs_readdata_alloc(rpages); |
171 | 172 | ||
172 | if (unlikely(!data)) { | 173 | if (unlikely(!data)) { |
173 | while (!list_empty(list)) { | 174 | while (!list_empty(list)) { |
@@ -431,7 +432,7 @@ static ssize_t nfs_direct_write_seg(struct inode *inode, | |||
431 | struct nfs_writeverf first_verf; | 432 | struct nfs_writeverf first_verf; |
432 | struct nfs_write_data *wdata; | 433 | struct nfs_write_data *wdata; |
433 | 434 | ||
434 | wdata = nfs_writedata_alloc(); | 435 | wdata = nfs_writedata_alloc(NFS_SERVER(inode)->wpages); |
435 | if (!wdata) | 436 | if (!wdata) |
436 | return -ENOMEM; | 437 | return -ENOMEM; |
437 | 438 | ||