Skip to content

Commit 6cccbb6

Browse files
westonandrosadamsonTom Haynes
authored andcommitted
nfs: rename pgio header ds_idx to ds_commit_idx
'ds_commit_idx' is a better name - it is used to select the right commit bucket for pnfs. Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
1 parent 309a1d6 commit 6cccbb6

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎fs/nfs/direct.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,22 @@ static inline int put_dreq(struct nfs_direct_req *dreq)
112112
* nfs_direct_select_verf - select the right verifier
113113
* @dreq - direct request possibly spanning multiple servers
114114
* @ds_clp - nfs_client of data server or NULL if MDS / non-pnfs
115-
* @ds_idx - index of data server in data server list, only valid if ds_clp set
115+
* @commit_idx - commit bucket index for the DS
116116
*
117117
* returns the correct verifier to use given the role of the server
118118
*/
119119
static struct nfs_writeverf *
120120
nfs_direct_select_verf(struct nfs_direct_req *dreq,
121121
struct nfs_client *ds_clp,
122-
int ds_idx)
122+
int commit_idx)
123123
{
124124
struct nfs_writeverf *verfp = &dreq->verf;
125125

126126
#ifdef CONFIG_NFS_V4_1
127127
if (ds_clp) {
128128
/* pNFS is in use, use the DS verf */
129-
if (ds_idx >= 0 && ds_idx < dreq->ds_cinfo.nbuckets)
130-
verfp = &dreq->ds_cinfo.buckets[ds_idx].direct_verf;
129+
if (commit_idx >= 0 && commit_idx < dreq->ds_cinfo.nbuckets)
130+
verfp = &dreq->ds_cinfo.buckets[commit_idx].direct_verf;
131131
else
132132
WARN_ON_ONCE(1);
133133
}
@@ -148,8 +148,7 @@ static void nfs_direct_set_hdr_verf(struct nfs_direct_req *dreq,
148148
{
149149
struct nfs_writeverf *verfp;
150150

151-
verfp = nfs_direct_select_verf(dreq, hdr->ds_clp,
152-
hdr->ds_idx);
151+
verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, hdr->ds_commit_idx);
153152
WARN_ON_ONCE(verfp->committed >= 0);
154153
memcpy(verfp, &hdr->verf, sizeof(struct nfs_writeverf));
155154
WARN_ON_ONCE(verfp->committed < 0);
@@ -169,8 +168,7 @@ static int nfs_direct_set_or_cmp_hdr_verf(struct nfs_direct_req *dreq,
169168
{
170169
struct nfs_writeverf *verfp;
171170

172-
verfp = nfs_direct_select_verf(dreq, hdr->ds_clp,
173-
hdr->ds_idx);
171+
verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, hdr->ds_commit_idx);
174172
if (verfp->committed < 0) {
175173
nfs_direct_set_hdr_verf(dreq, hdr);
176174
return 0;

‎fs/nfs/filelayout/filelayout.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ filelayout_read_pagelist(struct nfs_pgio_header *hdr)
492492
/* No multipath support. Use first DS */
493493
atomic_inc(&ds->ds_clp->cl_count);
494494
hdr->ds_clp = ds->ds_clp;
495-
hdr->ds_idx = idx;
495+
hdr->ds_commit_idx = idx;
496496
fh = nfs4_fl_select_ds_fh(lseg, j);
497497
if (fh)
498498
hdr->args.fh = fh;
@@ -536,7 +536,7 @@ filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync)
536536
hdr->pgio_done_cb = filelayout_write_done_cb;
537537
atomic_inc(&ds->ds_clp->cl_count);
538538
hdr->ds_clp = ds->ds_clp;
539-
hdr->ds_idx = idx;
539+
hdr->ds_commit_idx = idx;
540540
fh = nfs4_fl_select_ds_fh(lseg, j);
541541
if (fh)
542542
hdr->args.fh = fh;

‎include/linux/nfs_xdr.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ struct nfs_pgio_header {
13281328
__u64 mds_offset; /* Filelayout dense stripe */
13291329
struct nfs_page_array page_array;
13301330
struct nfs_client *ds_clp; /* pNFS data server */
1331-
int ds_idx; /* ds index if ds_clp is set */
1331+
int ds_commit_idx; /* ds index if ds_clp is set */
13321332
};
13331333

13341334
struct nfs_mds_commit_info {

0 commit comments

Comments
 (0)