diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-06-20 15:53:48 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-06-29 11:46:46 -0400 |
commit | 57208fa7e51ca16cd68de8e8bf482f16b06d3ea1 (patch) | |
tree | c34e830385439ac3ec5679c37266c2caa922e9aa /fs/nfs/pnfs.c | |
parent | 1abb50886afe8a126705c93dab2b50c1252a9c19 (diff) |
NFS: Create an write_pageio_init() function
pNFS needs to select a write function based on the layout driver
currently in use, so I let each NFS version decide how to best handle
initializing writes.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 9c830603a16c..2617831afd39 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1222,7 +1222,7 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode, | |||
1222 | nfs_pageio_init(pgio, inode, ld->pg_read_ops, compl_ops, server->rsize, 0); | 1222 | nfs_pageio_init(pgio, inode, ld->pg_read_ops, compl_ops, server->rsize, 0); |
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | bool | 1225 | void |
1226 | pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode, | 1226 | pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode, |
1227 | int ioflags, | 1227 | int ioflags, |
1228 | const struct nfs_pgio_completion_ops *compl_ops) | 1228 | const struct nfs_pgio_completion_ops *compl_ops) |
@@ -1231,10 +1231,9 @@ pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode, | |||
1231 | struct pnfs_layoutdriver_type *ld = server->pnfs_curr_ld; | 1231 | struct pnfs_layoutdriver_type *ld = server->pnfs_curr_ld; |
1232 | 1232 | ||
1233 | if (ld == NULL) | 1233 | if (ld == NULL) |
1234 | return false; | 1234 | nfs_pageio_init_write(pgio, inode, ioflags, compl_ops); |
1235 | nfs_pageio_init(pgio, inode, ld->pg_write_ops, compl_ops, | 1235 | else |
1236 | server->wsize, ioflags); | 1236 | nfs_pageio_init(pgio, inode, ld->pg_write_ops, compl_ops, server->wsize, ioflags); |
1237 | return true; | ||
1238 | } | 1237 | } |
1239 | 1238 | ||
1240 | bool | 1239 | bool |
@@ -1271,7 +1270,7 @@ int pnfs_write_done_resend_to_mds(struct inode *inode, | |||
1271 | LIST_HEAD(failed); | 1270 | LIST_HEAD(failed); |
1272 | 1271 | ||
1273 | /* Resend all requests through the MDS */ | 1272 | /* Resend all requests through the MDS */ |
1274 | nfs_pageio_init_write_mds(&pgio, inode, FLUSH_STABLE, compl_ops); | 1273 | nfs_pageio_init_write(&pgio, inode, FLUSH_STABLE, compl_ops); |
1275 | while (!list_empty(head)) { | 1274 | while (!list_empty(head)) { |
1276 | struct nfs_page *req = nfs_list_entry(head->next); | 1275 | struct nfs_page *req = nfs_list_entry(head->next); |
1277 | 1276 | ||