aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
authorGravatar Weston Andros Adamson <dros@primarydata.com> 2014-09-19 10:55:07 -0400
committerGravatar Tom Haynes <loghyr@primarydata.com> 2015-02-03 11:06:45 -0800
commita7d42ddb3099727f58366fa006f850a219cce6c8 (patch)
treec794857eb5c3ca29f77e259ecd3c155f841134d1 /fs/nfs/direct.c
parentpnfs: pass ds_commit_idx through the commit path (diff)
downloadlinux-a7d42ddb3099727f58366fa006f850a219cce6c8.tar.gz
linux-a7d42ddb3099727f58366fa006f850a219cce6c8.tar.bz2
linux-a7d42ddb3099727f58366fa006f850a219cce6c8.zip
nfs: add mirroring support to pgio layer
This patch adds mirrored write support to the pgio layer. The default is to use one mirror, but pgio callers may define callbacks to change this to any value up to the (arbitrarily selected) limit of 16. The basic idea is to break out members of nfs_pageio_descriptor that cannot be shared between mirrored DSes and put them in a new structure. Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 1ee41d74c31c..0178d4fe8ab7 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -360,8 +360,14 @@ static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
spin_lock(&dreq->lock);
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && (hdr->good_bytes == 0))
dreq->error = hdr->error;
- else
- dreq->count += hdr->good_bytes;
+ else {
+ /*
+ * FIXME: right now this only accounts for bytes written
+ * to the first mirror
+ */
+ if (hdr->pgio_mirror_idx == 0)
+ dreq->count += hdr->good_bytes;
+ }
spin_unlock(&dreq->lock);
while (!list_empty(&hdr->pages)) {
@@ -724,7 +730,12 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
dreq->error = hdr->error;
}
if (dreq->error == 0) {
- dreq->count += hdr->good_bytes;
+ /*
+ * FIXME: right now this only accounts for bytes written
+ * to the first mirror
+ */
+ if (hdr->pgio_mirror_idx == 0)
+ dreq->count += hdr->good_bytes;
if (nfs_write_need_commit(hdr)) {
if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES)
request_commit = true;