diff options
-rw-r--r-- | fs/nfs/internal.h | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/objlayout/objio_osd.c | 3 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 7 | ||||
-rw-r--r-- | fs/nfs/read.c | 2 | ||||
-rw-r--r-- | fs/nfs/write.c | 2 |
6 files changed, 15 insertions, 7 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index fc017eadfe08..31e8b50011af 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -296,7 +296,13 @@ extern int nfs_initiate_read(struct nfs_read_data *data, struct rpc_clnt *clnt, | |||
296 | const struct rpc_call_ops *call_ops); | 296 | const struct rpc_call_ops *call_ops); |
297 | extern void nfs_read_prepare(struct rpc_task *task, void *calldata); | 297 | extern void nfs_read_prepare(struct rpc_task *task, void *calldata); |
298 | 298 | ||
299 | struct nfs_pageio_descriptor; | ||
300 | extern void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, | ||
301 | struct inode *inode); | ||
302 | |||
299 | /* write.c */ | 303 | /* write.c */ |
304 | extern void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, | ||
305 | struct inode *inode, int ioflags); | ||
300 | extern void nfs_commit_free(struct nfs_write_data *p); | 306 | extern void nfs_commit_free(struct nfs_write_data *p); |
301 | extern int nfs_initiate_write(struct nfs_write_data *data, | 307 | extern int nfs_initiate_write(struct nfs_write_data *data, |
302 | struct rpc_clnt *clnt, | 308 | struct rpc_clnt *clnt, |
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index faac87f24797..d1ae5bfa6680 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -669,8 +669,6 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, | |||
669 | !nfs_generic_pg_test(pgio, prev, req)) | 669 | !nfs_generic_pg_test(pgio, prev, req)) |
670 | return false; | 670 | return false; |
671 | 671 | ||
672 | if (!pgio->pg_lseg) | ||
673 | return 1; | ||
674 | p_stripe = (u64)prev->wb_index << PAGE_CACHE_SHIFT; | 672 | p_stripe = (u64)prev->wb_index << PAGE_CACHE_SHIFT; |
675 | r_stripe = (u64)req->wb_index << PAGE_CACHE_SHIFT; | 673 | r_stripe = (u64)req->wb_index << PAGE_CACHE_SHIFT; |
676 | stripe_unit = FILELAYOUT_LSEG(pgio->pg_lseg)->stripe_unit; | 674 | stripe_unit = FILELAYOUT_LSEG(pgio->pg_lseg)->stripe_unit; |
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c index b759aeba57b9..70272d5355b2 100644 --- a/fs/nfs/objlayout/objio_osd.c +++ b/fs/nfs/objlayout/objio_osd.c | |||
@@ -1000,9 +1000,6 @@ static bool objio_pg_test(struct nfs_pageio_descriptor *pgio, | |||
1000 | if (!pnfs_generic_pg_test(pgio, prev, req)) | 1000 | if (!pnfs_generic_pg_test(pgio, prev, req)) |
1001 | return false; | 1001 | return false; |
1002 | 1002 | ||
1003 | if (pgio->pg_lseg == NULL) | ||
1004 | return true; | ||
1005 | |||
1006 | return pgio->pg_count + req->wb_bytes <= | 1003 | return pgio->pg_count + req->wb_bytes <= |
1007 | OBJIO_LSEG(pgio->pg_lseg)->max_io_size; | 1004 | OBJIO_LSEG(pgio->pg_lseg)->max_io_size; |
1008 | } | 1005 | } |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 69a0c3f1e462..cc807fe46953 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -1066,6 +1066,10 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r | |||
1066 | req->wb_bytes, | 1066 | req->wb_bytes, |
1067 | IOMODE_READ, | 1067 | IOMODE_READ, |
1068 | GFP_KERNEL); | 1068 | GFP_KERNEL); |
1069 | /* If no lseg, fall back to read through mds */ | ||
1070 | if (pgio->pg_lseg == NULL) | ||
1071 | nfs_pageio_init_read_mds(pgio, pgio->pg_inode); | ||
1072 | |||
1069 | } | 1073 | } |
1070 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read); | 1074 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read); |
1071 | 1075 | ||
@@ -1080,6 +1084,9 @@ pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page * | |||
1080 | req->wb_bytes, | 1084 | req->wb_bytes, |
1081 | IOMODE_RW, | 1085 | IOMODE_RW, |
1082 | GFP_NOFS); | 1086 | GFP_NOFS); |
1087 | /* If no lseg, fall back to write through mds */ | ||
1088 | if (pgio->pg_lseg == NULL) | ||
1089 | nfs_pageio_init_write_mds(pgio, pgio->pg_inode, pgio->pg_ioflags); | ||
1083 | } | 1090 | } |
1084 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_write); | 1091 | EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_write); |
1085 | 1092 | ||
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 2cf728b832cd..9b2a1d7fb760 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -114,7 +114,7 @@ static void nfs_readpage_truncate_uninitialised_page(struct nfs_read_data *data) | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | static void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, | 117 | void nfs_pageio_init_read_mds(struct nfs_pageio_descriptor *pgio, |
118 | struct inode *inode) | 118 | struct inode *inode) |
119 | { | 119 | { |
120 | nfs_pageio_init(pgio, inode, &nfs_pageio_read_ops, | 120 | nfs_pageio_init(pgio, inode, &nfs_pageio_read_ops, |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index d1ae7e45886f..00940dc9ab04 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1040,7 +1040,7 @@ static const struct nfs_pageio_ops nfs_pageio_write_ops = { | |||
1040 | .pg_doio = nfs_generic_pg_writepages, | 1040 | .pg_doio = nfs_generic_pg_writepages, |
1041 | }; | 1041 | }; |
1042 | 1042 | ||
1043 | static void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, | 1043 | void nfs_pageio_init_write_mds(struct nfs_pageio_descriptor *pgio, |
1044 | struct inode *inode, int ioflags) | 1044 | struct inode *inode, int ioflags) |
1045 | { | 1045 | { |
1046 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, | 1046 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, |