aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index e8915d4840ad..4c78c62639e6 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -77,19 +77,6 @@ filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset)
77 BUG(); 77 BUG();
78} 78}
79 79
80/* For data server errors we don't recover from */
81static void
82filelayout_set_lo_fail(struct pnfs_layout_segment *lseg)
83{
84 if (lseg->pls_range.iomode == IOMODE_RW) {
85 dprintk("%s Setting layout IOMODE_RW fail bit\n", __func__);
86 set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags);
87 } else {
88 dprintk("%s Setting layout IOMODE_READ fail bit\n", __func__);
89 set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags);
90 }
91}
92
93static int filelayout_async_handle_error(struct rpc_task *task, 80static int filelayout_async_handle_error(struct rpc_task *task,
94 struct nfs4_state *state, 81 struct nfs4_state *state,
95 struct nfs_client *clp, 82 struct nfs_client *clp,
@@ -145,7 +132,7 @@ static int filelayout_read_done_cb(struct rpc_task *task,
145 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n", 132 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
146 __func__, data->ds_clp, data->ds_clp->cl_session); 133 __func__, data->ds_clp, data->ds_clp->cl_session);
147 if (reset) { 134 if (reset) {
148 filelayout_set_lo_fail(data->lseg); 135 pnfs_set_lo_fail(data->lseg);
149 nfs4_reset_read(task, data); 136 nfs4_reset_read(task, data);
150 clp = NFS_SERVER(data->inode)->nfs_client; 137 clp = NFS_SERVER(data->inode)->nfs_client;
151 } 138 }
@@ -221,7 +208,7 @@ static int filelayout_write_done_cb(struct rpc_task *task,
221 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n", 208 dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
222 __func__, data->ds_clp, data->ds_clp->cl_session); 209 __func__, data->ds_clp, data->ds_clp->cl_session);
223 if (reset) { 210 if (reset) {
224 filelayout_set_lo_fail(data->lseg); 211 pnfs_set_lo_fail(data->lseg);
225 nfs4_reset_write(task, data); 212 nfs4_reset_write(task, data);
226 clp = NFS_SERVER(data->inode)->nfs_client; 213 clp = NFS_SERVER(data->inode)->nfs_client;
227 } else 214 } else
@@ -256,7 +243,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
256 __func__, data->ds_clp, data->ds_clp->cl_session); 243 __func__, data->ds_clp, data->ds_clp->cl_session);
257 if (reset) { 244 if (reset) {
258 prepare_to_resend_writes(data); 245 prepare_to_resend_writes(data);
259 filelayout_set_lo_fail(data->lseg); 246 pnfs_set_lo_fail(data->lseg);
260 } else 247 } else
261 nfs_restart_rpc(task, data->ds_clp); 248 nfs_restart_rpc(task, data->ds_clp);
262 return -EAGAIN; 249 return -EAGAIN;