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/pnfs.c | |
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/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e550e8836c37..6b19fffa812a 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1381,6 +1381,18 @@ static void pnfs_list_write_lseg(struct inode *inode, struct list_head *listp) | |||
1381 | } | 1381 | } |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | void pnfs_set_lo_fail(struct pnfs_layout_segment *lseg) | ||
1385 | { | ||
1386 | if (lseg->pls_range.iomode == IOMODE_RW) { | ||
1387 | dprintk("%s Setting layout IOMODE_RW fail bit\n", __func__); | ||
1388 | set_bit(lo_fail_bit(IOMODE_RW), &lseg->pls_layout->plh_flags); | ||
1389 | } else { | ||
1390 | dprintk("%s Setting layout IOMODE_READ fail bit\n", __func__); | ||
1391 | set_bit(lo_fail_bit(IOMODE_READ), &lseg->pls_layout->plh_flags); | ||
1392 | } | ||
1393 | } | ||
1394 | EXPORT_SYMBOL_GPL(pnfs_set_lo_fail); | ||
1395 | |||
1384 | void | 1396 | void |
1385 | pnfs_set_layoutcommit(struct nfs_write_data *wdata) | 1397 | pnfs_set_layoutcommit(struct nfs_write_data *wdata) |
1386 | { | 1398 | { |