aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e550e8836c37..ee73d9a4f700 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1168,23 +1168,17 @@ EXPORT_SYMBOL_GPL(pnfs_generic_pg_test);
1168/* 1168/*
1169 * Called by non rpc-based layout drivers 1169 * Called by non rpc-based layout drivers
1170 */ 1170 */
1171int 1171void pnfs_ld_write_done(struct nfs_write_data *data)
1172pnfs_ld_write_done(struct nfs_write_data *data)
1173{ 1172{
1174 int status; 1173 if (likely(!data->pnfs_error)) {
1175
1176 if (!data->pnfs_error) {
1177 pnfs_set_layoutcommit(data); 1174 pnfs_set_layoutcommit(data);
1178 data->mds_ops->rpc_call_done(&data->task, data); 1175 data->mds_ops->rpc_call_done(&data->task, data);
1179 data->mds_ops->rpc_release(data); 1176 } else {
1180 return 0; 1177 put_lseg(data->lseg);
1178 data->lseg = NULL;
1179 dprintk("pnfs write error = %d\n", data->pnfs_error);
1181 } 1180 }
1182 1181 data->mds_ops->rpc_release(data);
1183 dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__,
1184 data->pnfs_error);
1185 status = nfs_initiate_write(data, NFS_CLIENT(data->inode),
1186 data->mds_ops, NFS_FILE_SYNC);
1187 return status ? : -EAGAIN;
1188} 1182}
1189EXPORT_SYMBOL_GPL(pnfs_ld_write_done); 1183EXPORT_SYMBOL_GPL(pnfs_ld_write_done);
1190 1184
@@ -1268,23 +1262,17 @@ EXPORT_SYMBOL_GPL(pnfs_generic_pg_writepages);
1268/* 1262/*
1269 * Called by non rpc-based layout drivers 1263 * Called by non rpc-based layout drivers
1270 */ 1264 */
1271int 1265void pnfs_ld_read_done(struct nfs_read_data *data)
1272pnfs_ld_read_done(struct nfs_read_data *data)
1273{ 1266{
1274 int status; 1267 if (likely(!data->pnfs_error)) {
1275
1276 if (!data->pnfs_error) {
1277 __nfs4_read_done_cb(data); 1268 __nfs4_read_done_cb(data);
1278 data->mds_ops->rpc_call_done(&data->task, data); 1269 data->mds_ops->rpc_call_done(&data->task, data);
1279 data->mds_ops->rpc_release(data); 1270 } else {
1280 return 0; 1271 put_lseg(data->lseg);
1272 data->lseg = NULL;
1273 dprintk("pnfs write error = %d\n", data->pnfs_error);
1281 } 1274 }
1282 1275 data->mds_ops->rpc_release(data);
1283 dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__,
1284 data->pnfs_error);
1285 status = nfs_initiate_read(data, NFS_CLIENT(data->inode),
1286 data->mds_ops);
1287 return status ? : -EAGAIN;
1288} 1276}
1289EXPORT_SYMBOL_GPL(pnfs_ld_read_done); 1277EXPORT_SYMBOL_GPL(pnfs_ld_read_done);
1290 1278
@@ -1381,6 +1369,18 @@ static void pnfs_list_write_lseg(struct inode *inode, struct list_head *listp)
1381 } 1369 }
1382} 1370}
1383 1371
1372void pnfs_set_lo_fail(struct pnfs_layout_segment *lseg)
1373{
1374 if (lseg->pls_range.iomode == IOMODE_RW) {
1375 dprintk("%s Setting layout IOMODE_RW fail bit\n", __func__);
1376 set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
1377 } else {
1378 dprintk("%s Setting layout IOMODE_READ fail bit\n", __func__);
1379 set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
1380 }
1381}
1382EXPORT_SYMBOL_GPL(pnfs_set_lo_fail);
1383
1384void 1384void
1385pnfs_set_layoutcommit(struct nfs_write_data *wdata) 1385pnfs_set_layoutcommit(struct nfs_write_data *wdata)
1386{ 1386{