mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
NFS/flexfile: Simplify nfs4_ff_layout_ds_version()
Pass in a pointer to the mirror rather than forcing another array access. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
312cd4cb12
commit
626d48b12c
2 changed files with 5 additions and 5 deletions
|
@ -1787,7 +1787,7 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr)
|
||||||
if (!ds_cred)
|
if (!ds_cred)
|
||||||
goto out_failed;
|
goto out_failed;
|
||||||
|
|
||||||
vers = nfs4_ff_layout_ds_version(lseg, idx);
|
vers = nfs4_ff_layout_ds_version(mirror);
|
||||||
|
|
||||||
dprintk("%s USE DS: %s cl_count %d vers %d\n", __func__,
|
dprintk("%s USE DS: %s cl_count %d vers %d\n", __func__,
|
||||||
ds->ds_remotestr, refcount_read(&ds->ds_clp->cl_count), vers);
|
ds->ds_remotestr, refcount_read(&ds->ds_clp->cl_count), vers);
|
||||||
|
@ -1852,7 +1852,7 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
|
||||||
if (!ds_cred)
|
if (!ds_cred)
|
||||||
goto out_failed;
|
goto out_failed;
|
||||||
|
|
||||||
vers = nfs4_ff_layout_ds_version(lseg, idx);
|
vers = nfs4_ff_layout_ds_version(mirror);
|
||||||
|
|
||||||
dprintk("%s ino %lu sync %d req %zu@%llu DS: %s cl_count %d vers %d\n",
|
dprintk("%s ino %lu sync %d req %zu@%llu DS: %s cl_count %d vers %d\n",
|
||||||
__func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count,
|
__func__, hdr->inode->i_ino, sync, (size_t) hdr->args.count,
|
||||||
|
@ -1937,7 +1937,7 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
|
||||||
if (!ds_cred)
|
if (!ds_cred)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
vers = nfs4_ff_layout_ds_version(lseg, idx);
|
vers = nfs4_ff_layout_ds_version(mirror);
|
||||||
|
|
||||||
dprintk("%s ino %lu, how %d cl_count %d vers %d\n", __func__,
|
dprintk("%s ino %lu, how %d cl_count %d vers %d\n", __func__,
|
||||||
data->inode->i_ino, how, refcount_read(&ds->ds_clp->cl_count),
|
data->inode->i_ino, how, refcount_read(&ds->ds_clp->cl_count),
|
||||||
|
|
|
@ -181,9 +181,9 @@ ff_layout_no_read_on_rw(struct pnfs_layout_segment *lseg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
nfs4_ff_layout_ds_version(struct pnfs_layout_segment *lseg, u32 ds_idx)
|
nfs4_ff_layout_ds_version(const struct nfs4_ff_layout_mirror *mirror)
|
||||||
{
|
{
|
||||||
return FF_LAYOUT_COMP(lseg, ds_idx)->mirror_ds->ds_versions[0].version;
|
return mirror->mirror_ds->ds_versions[0].version;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct nfs4_ff_layout_ds *
|
struct nfs4_ff_layout_ds *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue