aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-03-23 09:27:46 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-23 15:29:03 -0400
commit5f452431e229ea14df61b0ac89eed5881414eef9 (patch)
treef4b364eb70f23f22806c51e063a599bd91fce57a /fs
parent9ace33cdc6562699a780b4716d9d52c55dd2151a (diff)
NFSv4.1: add callback to nfs4_commit_done
Add a callback that the pnfs layout driver can use to do its own error handling of the data server's COMMIT response. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4proc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1d84e7088af9..bcc29bdc9bee 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3195,12 +3195,9 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
3195 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE]; 3195 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE];
3196} 3196}
3197 3197
3198static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data) 3198static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *data)
3199{ 3199{
3200 struct inode *inode = data->inode; 3200 struct inode *inode = data->inode;
3201
3202 if (!nfs4_sequence_done(task, &data->res.seq_res))
3203 return -EAGAIN;
3204 3201
3205 if (nfs4_async_handle_error(task, NFS_SERVER(inode), NULL) == -EAGAIN) { 3202 if (nfs4_async_handle_error(task, NFS_SERVER(inode), NULL) == -EAGAIN) {
3206 nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client); 3203 nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
@@ -3210,11 +3207,20 @@ static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
3210 return 0; 3207 return 0;
3211} 3208}
3212 3209
3210static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
3211{
3212 if (!nfs4_sequence_done(task, &data->res.seq_res))
3213 return -EAGAIN;
3214 return data->write_done_cb(task, data);
3215}
3216
3213static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg) 3217static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
3214{ 3218{
3215 struct nfs_server *server = NFS_SERVER(data->inode); 3219 struct nfs_server *server = NFS_SERVER(data->inode);
3216 3220
3217 data->args.bitmask = server->cache_consistency_bitmask; 3221 data->args.bitmask = server->cache_consistency_bitmask;
3222 if (!data->write_done_cb)
3223 data->write_done_cb = nfs4_commit_done_cb;
3218 data->res.server = server; 3224 data->res.server = server;
3219 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; 3225 msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
3220} 3226}