diff options
author | Weston Andros Adamson <dros@primarydata.com> | 2014-09-16 17:35:51 -0400 |
---|---|---|
committer | Tom Haynes <loghyr@primarydata.com> | 2015-02-03 14:06:44 -0500 |
commit | 6cccbb6f52dceec5f4faed8846ac05ae830640e6 (patch) | |
tree | 881b137485077caf88df33a683c2ffbc9214a8fb /fs/nfs | |
parent | 309a1d65b11de24d172f7dbbc21583ebd649c912 (diff) |
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/direct.c | 14 | ||||
-rw-r--r-- | fs/nfs/filelayout/filelayout.c | 4 |
2 files changed, 8 insertions, 10 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index e84f764b9dcd..d7c2d430b04d 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -112,22 +112,22 @@ static inline int put_dreq(struct nfs_direct_req *dreq) | |||
112 | * nfs_direct_select_verf - select the right verifier | 112 | * nfs_direct_select_verf - select the right verifier |
113 | * @dreq - direct request possibly spanning multiple servers | 113 | * @dreq - direct request possibly spanning multiple servers |
114 | * @ds_clp - nfs_client of data server or NULL if MDS / non-pnfs | 114 | * @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 |
116 | * | 116 | * |
117 | * returns the correct verifier to use given the role of the server | 117 | * returns the correct verifier to use given the role of the server |
118 | */ | 118 | */ |
119 | static struct nfs_writeverf * | 119 | static struct nfs_writeverf * |
120 | nfs_direct_select_verf(struct nfs_direct_req *dreq, | 120 | nfs_direct_select_verf(struct nfs_direct_req *dreq, |
121 | struct nfs_client *ds_clp, | 121 | struct nfs_client *ds_clp, |
122 | int ds_idx) | 122 | int commit_idx) |
123 | { | 123 | { |
124 | struct nfs_writeverf *verfp = &dreq->verf; | 124 | struct nfs_writeverf *verfp = &dreq->verf; |
125 | 125 | ||
126 | #ifdef CONFIG_NFS_V4_1 | 126 | #ifdef CONFIG_NFS_V4_1 |
127 | if (ds_clp) { | 127 | if (ds_clp) { |
128 | /* pNFS is in use, use the DS verf */ | 128 | /* pNFS is in use, use the DS verf */ |
129 | if (ds_idx >= 0 && ds_idx < dreq->ds_cinfo.nbuckets) | 129 | if (commit_idx >= 0 && commit_idx < dreq->ds_cinfo.nbuckets) |
130 | verfp = &dreq->ds_cinfo.buckets[ds_idx].direct_verf; | 130 | verfp = &dreq->ds_cinfo.buckets[commit_idx].direct_verf; |
131 | else | 131 | else |
132 | WARN_ON_ONCE(1); | 132 | WARN_ON_ONCE(1); |
133 | } | 133 | } |
@@ -148,8 +148,7 @@ static void nfs_direct_set_hdr_verf(struct nfs_direct_req *dreq, | |||
148 | { | 148 | { |
149 | struct nfs_writeverf *verfp; | 149 | struct nfs_writeverf *verfp; |
150 | 150 | ||
151 | verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, | 151 | verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, hdr->ds_commit_idx); |
152 | hdr->ds_idx); | ||
153 | WARN_ON_ONCE(verfp->committed >= 0); | 152 | WARN_ON_ONCE(verfp->committed >= 0); |
154 | memcpy(verfp, &hdr->verf, sizeof(struct nfs_writeverf)); | 153 | memcpy(verfp, &hdr->verf, sizeof(struct nfs_writeverf)); |
155 | WARN_ON_ONCE(verfp->committed < 0); | 154 | WARN_ON_ONCE(verfp->committed < 0); |
@@ -169,8 +168,7 @@ static int nfs_direct_set_or_cmp_hdr_verf(struct nfs_direct_req *dreq, | |||
169 | { | 168 | { |
170 | struct nfs_writeverf *verfp; | 169 | struct nfs_writeverf *verfp; |
171 | 170 | ||
172 | verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, | 171 | verfp = nfs_direct_select_verf(dreq, hdr->ds_clp, hdr->ds_commit_idx); |
173 | hdr->ds_idx); | ||
174 | if (verfp->committed < 0) { | 172 | if (verfp->committed < 0) { |
175 | nfs_direct_set_hdr_verf(dreq, hdr); | 173 | nfs_direct_set_hdr_verf(dreq, hdr); |
176 | return 0; | 174 | return 0; |
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 2af32fc39d60..520cbc53e035 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c | |||
@@ -492,7 +492,7 @@ filelayout_read_pagelist(struct nfs_pgio_header *hdr) | |||
492 | /* No multipath support. Use first DS */ | 492 | /* No multipath support. Use first DS */ |
493 | atomic_inc(&ds->ds_clp->cl_count); | 493 | atomic_inc(&ds->ds_clp->cl_count); |
494 | hdr->ds_clp = ds->ds_clp; | 494 | hdr->ds_clp = ds->ds_clp; |
495 | hdr->ds_idx = idx; | 495 | hdr->ds_commit_idx = idx; |
496 | fh = nfs4_fl_select_ds_fh(lseg, j); | 496 | fh = nfs4_fl_select_ds_fh(lseg, j); |
497 | if (fh) | 497 | if (fh) |
498 | hdr->args.fh = fh; | 498 | hdr->args.fh = fh; |
@@ -536,7 +536,7 @@ filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync) | |||
536 | hdr->pgio_done_cb = filelayout_write_done_cb; | 536 | hdr->pgio_done_cb = filelayout_write_done_cb; |
537 | atomic_inc(&ds->ds_clp->cl_count); | 537 | atomic_inc(&ds->ds_clp->cl_count); |
538 | hdr->ds_clp = ds->ds_clp; | 538 | hdr->ds_clp = ds->ds_clp; |
539 | hdr->ds_idx = idx; | 539 | hdr->ds_commit_idx = idx; |
540 | fh = nfs4_fl_select_ds_fh(lseg, j); | 540 | fh = nfs4_fl_select_ds_fh(lseg, j); |
541 | if (fh) | 541 | if (fh) |
542 | hdr->args.fh = fh; | 542 | hdr->args.fh = fh; |