summaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout
diff options
context:
space:
mode:
authorPeng Tao <tao.peng@primarydata.com>2014-11-10 01:35:35 +0100
committerTom Haynes <loghyr@primarydata.com>2015-02-03 20:06:48 +0100
commit48d635f14a544c2b3ca870d2c7349b41160496d2 (patch)
tree3482ecc1445a13fb60941213930078da302869ff /fs/nfs/objlayout
parentnfs: only reset desc->pg_mirror_idx when mirroring is supported (diff)
downloadlinux-48d635f14a544c2b3ca870d2c7349b41160496d2.tar.xz
linux-48d635f14a544c2b3ca870d2c7349b41160496d2.zip
nfs: add nfs_pgio_current_mirror helper
Let it return current nfs_pgio_mirror in use depending on pg_mirror_count. For read, we always use pg_mirrors[0], so this effectively gives us freedom to use pg_mirror_idx to track the actual mirror to read from through out the IO stack. Signed-off-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Tom Haynes <loghyr@primarydata.com>
Diffstat (limited to 'fs/nfs/objlayout')
-rw-r--r--fs/nfs/objlayout/objio_osd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 9a5f2ee6001f..24e1d7403c0b 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -537,7 +537,7 @@ int objio_write_pagelist(struct nfs_pgio_header *hdr, int how)
static size_t objio_pg_test(struct nfs_pageio_descriptor *pgio,
struct nfs_page *prev, struct nfs_page *req)
{
- struct nfs_pgio_mirror *mirror = &pgio->pg_mirrors[pgio->pg_mirror_idx];
+ struct nfs_pgio_mirror *mirror = nfs_pgio_current_mirror(pgio);
unsigned int size;
size = pnfs_generic_pg_test(pgio, prev, req);