diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-03 03:55:04 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:39 -0500 |
commit | 963d8fe53339128ee46a7701f2e36305f0ccff8c (patch) | |
tree | 426736c70a8e05cb1d945d5c7f44ea6475edd113 /fs/nfs/read.c | |
parent | abbcf28f23d53e8ec56a91f3528743913fa2694a (diff) |
RPC: Clean up RPC task structure
Shrink the RPC task structure. Instead of storing separate pointers
for task->tk_exit and task->tk_release, put them in a structure.
Also pass the user data pointer as a parameter instead of passing it via
task->tk_calldata. This enables us to nest callbacks.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 5f20eafba8ec..21486242c3d3 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 | ||
@@ -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, |
@@ -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; |