diff options
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 5f20eafba8ec..05eb43fadf8e 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -42,9 +42,8 @@ mempool_t *nfs_rdata_mempool; | |||
42 | 42 | ||
43 | #define MIN_POOL_READ (32) | 43 | #define MIN_POOL_READ (32) |
44 | 44 | ||
45 | void nfs_readdata_release(struct rpc_task *task) | 45 | void nfs_readdata_release(void *data) |
46 | { | 46 | { |
47 | struct nfs_read_data *data = (struct nfs_read_data *)task->tk_calldata; | ||
48 | nfs_readdata_free(data); | 47 | nfs_readdata_free(data); |
49 | } | 48 | } |
50 | 49 | ||
@@ -84,7 +83,7 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, | |||
84 | int result; | 83 | int result; |
85 | struct nfs_read_data *rdata; | 84 | struct nfs_read_data *rdata; |
86 | 85 | ||
87 | rdata = nfs_readdata_alloc(); | 86 | rdata = nfs_readdata_alloc(1); |
88 | if (!rdata) | 87 | if (!rdata) |
89 | return -ENOMEM; | 88 | return -ENOMEM; |
90 | 89 | ||
@@ -220,9 +219,6 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, | |||
220 | NFS_PROTO(inode)->read_setup(data); | 219 | NFS_PROTO(inode)->read_setup(data); |
221 | 220 | ||
222 | data->task.tk_cookie = (unsigned long)inode; | 221 | data->task.tk_cookie = (unsigned long)inode; |
223 | data->task.tk_calldata = data; | ||
224 | /* Release requests */ | ||
225 | data->task.tk_release = nfs_readdata_release; | ||
226 | 222 | ||
227 | dprintk("NFS: %4d initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", | 223 | dprintk("NFS: %4d initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", |
228 | data->task.tk_pid, | 224 | data->task.tk_pid, |
@@ -287,7 +283,7 @@ static int nfs_pagein_multi(struct list_head *head, struct inode *inode) | |||
287 | 283 | ||
288 | nbytes = req->wb_bytes; | 284 | nbytes = req->wb_bytes; |
289 | for(;;) { | 285 | for(;;) { |
290 | data = nfs_readdata_alloc(); | 286 | data = nfs_readdata_alloc(1); |
291 | if (!data) | 287 | if (!data) |
292 | goto out_bad; | 288 | goto out_bad; |
293 | INIT_LIST_HEAD(&data->pages); | 289 | INIT_LIST_HEAD(&data->pages); |
@@ -343,7 +339,7 @@ static int nfs_pagein_one(struct list_head *head, struct inode *inode) | |||
343 | if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE) | 339 | if (NFS_SERVER(inode)->rsize < PAGE_CACHE_SIZE) |
344 | return nfs_pagein_multi(head, inode); | 340 | return nfs_pagein_multi(head, inode); |
345 | 341 | ||
346 | data = nfs_readdata_alloc(); | 342 | data = nfs_readdata_alloc(NFS_SERVER(inode)->rpages); |
347 | if (!data) | 343 | if (!data) |
348 | goto out_bad; | 344 | goto out_bad; |
349 | 345 | ||
@@ -452,9 +448,9 @@ static void nfs_readpage_result_full(struct nfs_read_data *data, int status) | |||
452 | * This is the callback from RPC telling us whether a reply was | 448 | * This is the callback from RPC telling us whether a reply was |
453 | * received or some error occurred (timeout or socket shutdown). | 449 | * received or some error occurred (timeout or socket shutdown). |
454 | */ | 450 | */ |
455 | void nfs_readpage_result(struct rpc_task *task) | 451 | void nfs_readpage_result(struct rpc_task *task, void *calldata) |
456 | { | 452 | { |
457 | struct nfs_read_data *data = (struct nfs_read_data *)task->tk_calldata; | 453 | struct nfs_read_data *data = calldata; |
458 | struct nfs_readargs *argp = &data->args; | 454 | struct nfs_readargs *argp = &data->args; |
459 | struct nfs_readres *resp = &data->res; | 455 | struct nfs_readres *resp = &data->res; |
460 | int status = task->tk_status; | 456 | int status = task->tk_status; |