summaryrefslogtreecommitdiff
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-05-06 09:12:39 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-29 11:11:41 -0400
commitcf485fcd68bc2dd91258e844ba4649404fff3235 (patch)
treebd96e9d04ca73644770ae95d06c05d1a49fb3c08 /fs/nfs/read.c
parentc3766276f26090f4459329839cdcc8506dfbced5 (diff)
downloadlinux-cf485fcd68bc2dd91258e844ba4649404fff3235.tar.gz
linux-cf485fcd68bc2dd91258e844ba4649404fff3235.tar.xz
NFS: Create a common generic_pg_pgios()
What we have here is two functions that look identical. Let's share some more code! Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index b834d458a2b6..ebd1666ee13c 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -178,32 +178,9 @@ static const struct nfs_pgio_completion_ops nfs_async_read_completion_ops = {
.completion = nfs_read_completion,
};
-static int nfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc)
-{
- struct nfs_rw_header *rhdr;
- struct nfs_pgio_header *hdr;
- int ret;
-
- rhdr = nfs_rw_header_alloc(desc->pg_rw_ops);
- if (!rhdr) {
- desc->pg_completion_ops->error_cleanup(&desc->pg_list);
- return -ENOMEM;
- }
- hdr = &rhdr->header;
- nfs_pgheader_init(desc, hdr, nfs_rw_header_free);
- atomic_inc(&hdr->refcnt);
- ret = nfs_generic_pgio(desc, hdr);
- if (ret == 0)
- ret = nfs_do_multiple_pgios(&hdr->rpc_list,
- desc->pg_rpc_callops, 0);
- if (atomic_dec_and_test(&hdr->refcnt))
- hdr->completion_ops->completion(hdr);
- return ret;
-}
-
static const struct nfs_pageio_ops nfs_pageio_read_ops = {
.pg_test = nfs_generic_pg_test,
- .pg_doio = nfs_generic_pg_readpages,
+ .pg_doio = nfs_generic_pg_pgios,
};
/*