aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-03-03 10:13:42 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-11 15:38:43 -0500
commitb029bc9b0880cbaf999f580c0ea8f06dd274fc77 (patch)
tree3dc527df82e2bb76ee91dc3f511f40f7ded6e747 /fs/nfs/nfs4proc.c
parentd138d5d17be6a60d883e8bd4e22bc218d3adfab3 (diff)
NFSv4.1: add callback to nfs4_write_done
Add callback that pnfs layout driver can use to do its own handling of data server WRITE response. 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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1dc809039448..15248549c89f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3123,13 +3123,10 @@ void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data)
3123} 3123}
3124EXPORT_SYMBOL_GPL(nfs4_reset_read); 3124EXPORT_SYMBOL_GPL(nfs4_reset_read);
3125 3125
3126static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data) 3126static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data)
3127{ 3127{
3128 struct inode *inode = data->inode; 3128 struct inode *inode = data->inode;
3129 3129
3130 if (!nfs4_sequence_done(task, &data->res.seq_res))
3131 return -EAGAIN;
3132
3133 if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) { 3130 if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) {
3134 nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client); 3131 nfs_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
3135 return -EAGAIN; 3132 return -EAGAIN;
@@ -3141,11 +3138,20 @@ static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
3141 return 0; 3138 return 0;
3142} 3139}
3143 3140
3141static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
3142{
3143 if (!nfs4_sequence_done(task, &data->res.seq_res))
3144 return -EAGAIN;
3145 return data->write_done_cb(task, data);
3146}
3147
3144static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) 3148static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
3145{ 3149{
3146 struct nfs_server *server = NFS_SERVER(data->inode); 3150 struct nfs_server *server = NFS_SERVER(data->inode);
3147 3151
3148 data->args.bitmask = server->cache_consistency_bitmask; 3152 data->args.bitmask = server->cache_consistency_bitmask;
3153 if (!data->write_done_cb)
3154 data->write_done_cb = nfs4_write_done_cb;
3149 data->res.server = server; 3155 data->res.server = server;
3150 data->timestamp = jiffies; 3156 data->timestamp = jiffies;
3151 3157