diff options
-rw-r--r-- | fs/nfs/nfs4proc.c | 14 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
2 files changed, 11 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 | } |
3124 | EXPORT_SYMBOL_GPL(nfs4_reset_read); | 3124 | EXPORT_SYMBOL_GPL(nfs4_reset_read); |
3125 | 3125 | ||
3126 | static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data) | 3126 | static 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 | ||
3141 | static 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 | |||
3144 | static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) | 3148 | static 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 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index eb0e87084353..21cd41ddbca6 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1038,6 +1038,7 @@ struct nfs_write_data { | |||
1038 | unsigned int npages; /* Max length of pagevec */ | 1038 | unsigned int npages; /* Max length of pagevec */ |
1039 | struct nfs_writeargs args; /* argument struct */ | 1039 | struct nfs_writeargs args; /* argument struct */ |
1040 | struct nfs_writeres res; /* result struct */ | 1040 | struct nfs_writeres res; /* result struct */ |
1041 | int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); | ||
1041 | #ifdef CONFIG_NFS_V4 | 1042 | #ifdef CONFIG_NFS_V4 |
1042 | unsigned long timestamp; /* For lease renewal */ | 1043 | unsigned long timestamp; /* For lease renewal */ |
1043 | #endif | 1044 | #endif |