aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@primarydata.com>2014-09-19 10:55:07 -0400
committerTom Haynes <loghyr@primarydata.com>2015-02-03 14:06:45 -0500
commita7d42ddb3099727f58366fa006f850a219cce6c8 (patch)
treec794857eb5c3ca29f77e259ecd3c155f841134d1 /include/linux
parentb57ff1303a2d4d1484c7a82bd80a3e014d6cdf5e (diff)
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 'include/linux')
-rw-r--r--include/linux/nfs_page.h20
-rw-r--r--include/linux/nfs_xdr.h1
2 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 479c566c4ddc..3eb072dbce83 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -58,6 +58,8 @@ struct nfs_pageio_ops {
58 size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, 58 size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *,
59 struct nfs_page *); 59 struct nfs_page *);
60 int (*pg_doio)(struct nfs_pageio_descriptor *); 60 int (*pg_doio)(struct nfs_pageio_descriptor *);
61 unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *,
62 struct nfs_page *);
61 void (*pg_cleanup)(struct nfs_pageio_descriptor *); 63 void (*pg_cleanup)(struct nfs_pageio_descriptor *);
62}; 64};
63 65
@@ -74,15 +76,17 @@ struct nfs_rw_ops {
74 struct rpc_task_setup *, int); 76 struct rpc_task_setup *, int);
75}; 77};
76 78
77struct nfs_pageio_descriptor { 79struct nfs_pgio_mirror {
78 struct list_head pg_list; 80 struct list_head pg_list;
79 unsigned long pg_bytes_written; 81 unsigned long pg_bytes_written;
80 size_t pg_count; 82 size_t pg_count;
81 size_t pg_bsize; 83 size_t pg_bsize;
82 unsigned int pg_base; 84 unsigned int pg_base;
83 unsigned char pg_moreio : 1, 85 unsigned char pg_recoalesce : 1;
84 pg_recoalesce : 1; 86};
85 87
88struct nfs_pageio_descriptor {
89 unsigned char pg_moreio : 1;
86 struct inode *pg_inode; 90 struct inode *pg_inode;
87 const struct nfs_pageio_ops *pg_ops; 91 const struct nfs_pageio_ops *pg_ops;
88 const struct nfs_rw_ops *pg_rw_ops; 92 const struct nfs_rw_ops *pg_rw_ops;
@@ -93,8 +97,18 @@ struct nfs_pageio_descriptor {
93 struct pnfs_layout_segment *pg_lseg; 97 struct pnfs_layout_segment *pg_lseg;
94 struct nfs_direct_req *pg_dreq; 98 struct nfs_direct_req *pg_dreq;
95 void *pg_layout_private; 99 void *pg_layout_private;
100 unsigned int pg_bsize; /* default bsize for mirrors */
101
102 u32 pg_mirror_count;
103 struct nfs_pgio_mirror *pg_mirrors;
104 struct nfs_pgio_mirror pg_mirrors_static[1];
105 struct nfs_pgio_mirror *pg_mirrors_dynamic;
106 u32 pg_mirror_idx; /* current mirror */
96}; 107};
97 108
109/* arbitrarily selected limit to number of mirrors */
110#define NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX 16
111
98#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 112#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
99 113
100extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, 114extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5bc99f04a550..6400a1e01aa4 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1329,6 +1329,7 @@ struct nfs_pgio_header {
1329 struct nfs_page_array page_array; 1329 struct nfs_page_array page_array;
1330 struct nfs_client *ds_clp; /* pNFS data server */ 1330 struct nfs_client *ds_clp; /* pNFS data server */
1331 int ds_commit_idx; /* ds index if ds_clp is set */ 1331 int ds_commit_idx; /* ds index if ds_clp is set */
1332 int pgio_mirror_idx;/* mirror index in pgio layer */
1332}; 1333};
1333 1334
1334struct nfs_mds_commit_info { 1335struct nfs_mds_commit_info {