diff options
author | Fred Isaman <iisaman@netapp.com> | 2012-04-20 14:47:39 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 14:10:37 -0400 |
commit | 0b7c01533aa9f4a228d07d2768d084acb3a387bc (patch) | |
tree | aa57b08ce42f1effea2294354e3c9770b70e7612 /fs/nfs/nfs4proc.c | |
parent | 799ba8d53d32c84bd2a867ca2689538a48176140 (diff) |
NFS: add a struct nfs_commit_data to replace nfs_write_data in commits
Commits don't need the vectors of pages, etc. that writes do. Split out
a separate structure for the commit operation.
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 75eb883ed4ce..cc04b6e409ed 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3468,7 +3468,17 @@ static void nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_ | |||
3468 | rpc_call_start(task); | 3468 | rpc_call_start(task); |
3469 | } | 3469 | } |
3470 | 3470 | ||
3471 | static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *data) | 3471 | static void nfs4_proc_commit_rpc_prepare(struct rpc_task *task, struct nfs_commit_data *data) |
3472 | { | ||
3473 | if (nfs4_setup_sequence(NFS_SERVER(data->inode), | ||
3474 | &data->args.seq_args, | ||
3475 | &data->res.seq_res, | ||
3476 | task)) | ||
3477 | return; | ||
3478 | rpc_call_start(task); | ||
3479 | } | ||
3480 | |||
3481 | static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_commit_data *data) | ||
3472 | { | 3482 | { |
3473 | struct inode *inode = data->inode; | 3483 | struct inode *inode = data->inode; |
3474 | 3484 | ||
@@ -3480,14 +3490,14 @@ static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *dat | |||
3480 | return 0; | 3490 | return 0; |
3481 | } | 3491 | } |
3482 | 3492 | ||
3483 | static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data) | 3493 | static int nfs4_commit_done(struct rpc_task *task, struct nfs_commit_data *data) |
3484 | { | 3494 | { |
3485 | if (!nfs4_sequence_done(task, &data->res.seq_res)) | 3495 | if (!nfs4_sequence_done(task, &data->res.seq_res)) |
3486 | return -EAGAIN; | 3496 | return -EAGAIN; |
3487 | return data->write_done_cb(task, data); | 3497 | return data->commit_done_cb(task, data); |
3488 | } | 3498 | } |
3489 | 3499 | ||
3490 | static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg) | 3500 | static void nfs4_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg) |
3491 | { | 3501 | { |
3492 | struct nfs_server *server = NFS_SERVER(data->inode); | 3502 | struct nfs_server *server = NFS_SERVER(data->inode); |
3493 | 3503 | ||
@@ -3496,8 +3506,8 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa | |||
3496 | data->res.fattr = NULL; | 3506 | data->res.fattr = NULL; |
3497 | } else | 3507 | } else |
3498 | data->args.bitmask = server->cache_consistency_bitmask; | 3508 | data->args.bitmask = server->cache_consistency_bitmask; |
3499 | if (!data->write_done_cb) | 3509 | if (data->commit_done_cb == NULL) |
3500 | data->write_done_cb = nfs4_commit_done_cb; | 3510 | data->commit_done_cb = nfs4_commit_done_cb; |
3501 | data->res.server = server; | 3511 | data->res.server = server; |
3502 | msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; | 3512 | msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; |
3503 | nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 1); | 3513 | nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 1); |
@@ -6591,6 +6601,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
6591 | .write_rpc_prepare = nfs4_proc_write_rpc_prepare, | 6601 | .write_rpc_prepare = nfs4_proc_write_rpc_prepare, |
6592 | .write_done = nfs4_write_done, | 6602 | .write_done = nfs4_write_done, |
6593 | .commit_setup = nfs4_proc_commit_setup, | 6603 | .commit_setup = nfs4_proc_commit_setup, |
6604 | .commit_rpc_prepare = nfs4_proc_commit_rpc_prepare, | ||
6594 | .commit_done = nfs4_commit_done, | 6605 | .commit_done = nfs4_commit_done, |
6595 | .lock = nfs4_proc_lock, | 6606 | .lock = nfs4_proc_lock, |
6596 | .clear_acl_cache = nfs4_zap_acl_attr, | 6607 | .clear_acl_cache = nfs4_zap_acl_attr, |