diff options
author | Peng Tao <bergwolf@gmail.com> | 2011-09-22 21:50:12 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-18 12:08:13 -0400 |
commit | 1b0ae068779874f54b55aac3a2a992bcf3f2c3c4 (patch) | |
tree | 2cfc6f406312ca02704fedb9675a02a5ec2993bf /fs/nfs/blocklayout | |
parent | 760383f1ee4d14b0e0bdf0cddee648d9b8633429 (diff) |
pnfs: make _set_lo_fail generic
file layout and block layout both use it to set mark layout io failure
bit. So make it generic.
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Cc: stable@kernel.org [3.0]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index dee6cae80fea..2167ba2afdbb 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c | |||
@@ -176,17 +176,6 @@ retry: | |||
176 | return bio; | 176 | return bio; |
177 | } | 177 | } |
178 | 178 | ||
179 | static void bl_set_lo_fail(struct pnfs_layout_segment *lseg) | ||
180 | { | ||
181 | if (lseg->pls_range.iomode == IOMODE_RW) { | ||
182 | dprintk("%s Setting layout IOMODE_RW fail bit\n", __func__); | ||
183 | set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags); | ||
184 | } else { | ||
185 | dprintk("%s Setting layout IOMODE_READ fail bit\n", __func__); | ||
186 | set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | /* This is basically copied from mpage_end_io_read */ | 179 | /* This is basically copied from mpage_end_io_read */ |
191 | static void bl_end_io_read(struct bio *bio, int err) | 180 | static void bl_end_io_read(struct bio *bio, int err) |
192 | { | 181 | { |
@@ -206,7 +195,7 @@ static void bl_end_io_read(struct bio *bio, int err) | |||
206 | if (!uptodate) { | 195 | if (!uptodate) { |
207 | if (!rdata->pnfs_error) | 196 | if (!rdata->pnfs_error) |
208 | rdata->pnfs_error = -EIO; | 197 | rdata->pnfs_error = -EIO; |
209 | bl_set_lo_fail(rdata->lseg); | 198 | pnfs_set_lo_fail(rdata->lseg); |
210 | } | 199 | } |
211 | bio_put(bio); | 200 | bio_put(bio); |
212 | put_parallel(par); | 201 | put_parallel(par); |
@@ -370,7 +359,7 @@ static void bl_end_io_write_zero(struct bio *bio, int err) | |||
370 | if (!uptodate) { | 359 | if (!uptodate) { |
371 | if (!wdata->pnfs_error) | 360 | if (!wdata->pnfs_error) |
372 | wdata->pnfs_error = -EIO; | 361 | wdata->pnfs_error = -EIO; |
373 | bl_set_lo_fail(wdata->lseg); | 362 | pnfs_set_lo_fail(wdata->lseg); |
374 | } | 363 | } |
375 | bio_put(bio); | 364 | bio_put(bio); |
376 | put_parallel(par); | 365 | put_parallel(par); |
@@ -386,7 +375,7 @@ static void bl_end_io_write(struct bio *bio, int err) | |||
386 | if (!uptodate) { | 375 | if (!uptodate) { |
387 | if (!wdata->pnfs_error) | 376 | if (!wdata->pnfs_error) |
388 | wdata->pnfs_error = -EIO; | 377 | wdata->pnfs_error = -EIO; |
389 | bl_set_lo_fail(wdata->lseg); | 378 | pnfs_set_lo_fail(wdata->lseg); |
390 | } | 379 | } |
391 | bio_put(bio); | 380 | bio_put(bio); |
392 | put_parallel(par); | 381 | put_parallel(par); |