@@ -1183,7 +1183,7 @@ bl_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
{
if (pgio->pg_dreq != NULL &&
!is_aligned_req(req, SECTOR_SIZE))
- nfs_pageio_reset_read_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
else
pnfs_generic_pg_init_read(pgio, req);
}
@@ -1231,7 +1231,7 @@ bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
{
if (pgio->pg_dreq != NULL &&
!is_aligned_req(req, PAGE_CACHE_SIZE)) {
- nfs_pageio_reset_write_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
} else {
u64 wb_size;
if (pgio->pg_dreq == NULL)
@@ -406,7 +406,6 @@ extern void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
struct inode *inode, bool force_mds,
const struct nfs_pgio_completion_ops *compl_ops);
extern void nfs_read_prepare(struct rpc_task *task, void *calldata);
-extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio);
/* super.c */
void nfs_clone_super(struct super_block *, struct nfs_mount_info *);
@@ -423,7 +422,6 @@ int nfs_remount(struct super_block *sb, int *flags, char *raw_data);
extern void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,
struct inode *inode, int ioflags, bool force_mds,
const struct nfs_pgio_completion_ops *compl_ops);
-extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio);
extern void nfs_commit_free(struct nfs_commit_data *p);
extern void nfs_write_prepare(struct rpc_task *task, void *calldata);
extern void nfs_commit_prepare(struct rpc_task *task, void *calldata);
@@ -957,7 +957,7 @@ filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
GFP_KERNEL);
/* If no lseg, fall back to read through mds */
if (pgio->pg_lseg == NULL)
- nfs_pageio_reset_read_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
}
static void
@@ -986,7 +986,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
}
return;
out_mds:
- nfs_pageio_reset_write_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
}
static const struct nfs_pageio_ops filelayout_pg_read_ops = {
@@ -1040,3 +1040,4 @@ const struct nfs_pageio_ops nfs_pgio_rw_ops = {
.pg_test = nfs_generic_pg_test,
.pg_doio = nfs_generic_pg_pgios,
};
+EXPORT_SYMBOL_GPL(nfs_pgio_rw_ops);
@@ -1381,6 +1381,12 @@ out_forget_reply:
goto out;
}
+void pnfs_pageio_reset_mds(struct nfs_pageio_descriptor *pgio)
+{
+ pgio->pg_ops = &nfs_pgio_rw_ops;
+}
+EXPORT_SYMBOL_GPL(pnfs_pageio_reset_mds);
+
void
pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
{
@@ -1401,7 +1407,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
GFP_KERNEL);
/* If no lseg, fall back to read through mds */
if (pgio->pg_lseg == NULL)
- nfs_pageio_reset_read_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
}
EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read);
@@ -1420,7 +1426,7 @@ pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
GFP_NOFS);
/* If no lseg, fall back to write through mds */
if (pgio->pg_lseg == NULL)
- nfs_pageio_reset_write_mds(pgio);
+ pnfs_pageio_reset_mds(pgio);
}
EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_write);
@@ -1510,7 +1516,7 @@ pnfs_write_through_mds(struct nfs_pageio_descriptor *desc,
{
if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) {
list_splice_tail_init(&hdr->pages, &desc->pg_list);
- nfs_pageio_reset_write_mds(desc);
+ pnfs_pageio_reset_mds(desc);
desc->pg_recoalesce = 1;
}
nfs_generic_pgio_reset(hdr);
@@ -1627,7 +1633,7 @@ pnfs_read_through_mds(struct nfs_pageio_descriptor *desc,
{
if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) {
list_splice_tail_init(&hdr->pages, &desc->pg_list);
- nfs_pageio_reset_read_mds(desc);
+ pnfs_pageio_reset_mds(desc);
desc->pg_recoalesce = 1;
}
nfs_generic_pgio_reset(hdr);
@@ -186,6 +186,7 @@ void pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *, struct nfs_page *
int pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc);
void pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req, u64 wb_size);
+void pnfs_pageio_reset_mds(struct nfs_pageio_descriptor *pgio);
int pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc);
size_t pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio,
struct nfs_page *prev, struct nfs_page *req);
@@ -68,13 +68,6 @@ void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
}
EXPORT_SYMBOL_GPL(nfs_pageio_init_read);
-void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio)
-{
- pgio->pg_ops = &nfs_pgio_rw_ops;
- pgio->pg_bsize = NFS_SERVER(pgio->pg_inode)->rsize;
-}
-EXPORT_SYMBOL_GPL(nfs_pageio_reset_read_mds);
-
int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
struct page *page)
{
@@ -1063,14 +1063,6 @@ void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio,
}
EXPORT_SYMBOL_GPL(nfs_pageio_init_write);
-void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio)
-{
- pgio->pg_ops = &nfs_pgio_rw_ops;
- pgio->pg_bsize = NFS_SERVER(pgio->pg_inode)->wsize;
-}
-EXPORT_SYMBOL_GPL(nfs_pageio_reset_write_mds);
-
-
void nfs_commit_prepare(struct rpc_task *task, void *calldata)
{
struct nfs_commit_data *data = calldata;
bsize never changes once it is set in the pageio descriptor, so we don't need to add extra code to reset it. I also moved this function into pnfs.c because it is only called from pnfs. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> --- fs/nfs/blocklayout/blocklayout.c | 4 ++-- fs/nfs/internal.h | 2 -- fs/nfs/nfs4filelayout.c | 4 ++-- fs/nfs/pagelist.c | 1 + fs/nfs/pnfs.c | 14 ++++++++++---- fs/nfs/pnfs.h | 1 + fs/nfs/read.c | 7 ------- fs/nfs/write.c | 8 -------- 8 files changed, 16 insertions(+), 25 deletions(-)