aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/flexfilelayout/flexfilelayoutdev.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-28 10:34:13 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-03-01 22:37:38 -0500
commit749da527b3e7bff92cc76b907bc222ef2df6fcdc (patch)
tree0b01b02bbedf1fa5309f10e7ab2db3fec1f00bb2 /fs/nfs/flexfilelayout/flexfilelayoutdev.c
parentNFS/flexfiles: Speed up read failover when DSes are down (diff)
downloadlinux-dev-749da527b3e7bff92cc76b907bc222ef2df6fcdc.tar.xz
linux-dev-749da527b3e7bff92cc76b907bc222ef2df6fcdc.zip
NFS/flexfiles: Simplify nfs4_ff_layout_select_ds_fh()
Pass in a pointer to the mirror rather than having to retrieve it from the array and then verify the resulting pointer. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/flexfilelayout/flexfilelayoutdev.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
index 7fd92226e4b9..3a2419313fe9 100644
--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -351,21 +351,10 @@ ff_layout_get_mirror_cred(struct nfs4_ff_layout_mirror *mirror, u32 iomode)
}
struct nfs_fh *
-nfs4_ff_layout_select_ds_fh(struct pnfs_layout_segment *lseg, u32 mirror_idx)
+nfs4_ff_layout_select_ds_fh(struct nfs4_ff_layout_mirror *mirror)
{
- struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, mirror_idx);
- struct nfs_fh *fh = NULL;
-
- if (!ff_layout_mirror_valid(lseg, mirror, false)) {
- pr_err_ratelimited("NFS: %s: No data server for mirror offset index %d\n",
- __func__, mirror_idx);
- goto out;
- }
-
/* FIXME: For now assume there is only 1 version available for the DS */
- fh = &mirror->fh_versions[0];
-out:
- return fh;
+ return &mirror->fh_versions[0];
}
int