aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 6fdcd233d6f7..067104cce181 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1546,7 +1546,7 @@ pnfs_write_through_mds(struct nfs_pageio_descriptor *desc,
1546 nfs_pageio_reset_write_mds(desc); 1546 nfs_pageio_reset_write_mds(desc);
1547 desc->pg_recoalesce = 1; 1547 desc->pg_recoalesce = 1;
1548 } 1548 }
1549 nfs_pgio_data_release(data); 1549 nfs_pgio_data_destroy(data);
1550} 1550}
1551 1551
1552static enum pnfs_try_status 1552static enum pnfs_try_status
@@ -1575,7 +1575,7 @@ static void
1575pnfs_do_write(struct nfs_pageio_descriptor *desc, 1575pnfs_do_write(struct nfs_pageio_descriptor *desc,
1576 struct nfs_pgio_header *hdr, int how) 1576 struct nfs_pgio_header *hdr, int how)
1577{ 1577{
1578 struct nfs_pgio_data *data = hdr->data; 1578 struct nfs_pgio_data *data = &hdr->data;
1579 const struct rpc_call_ops *call_ops = desc->pg_rpc_callops; 1579 const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
1580 struct pnfs_layout_segment *lseg = desc->pg_lseg; 1580 struct pnfs_layout_segment *lseg = desc->pg_lseg;
1581 enum pnfs_try_status trypnfs; 1581 enum pnfs_try_status trypnfs;
@@ -1590,25 +1590,23 @@ pnfs_do_write(struct nfs_pageio_descriptor *desc,
1590static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) 1590static void pnfs_writehdr_free(struct nfs_pgio_header *hdr)
1591{ 1591{
1592 pnfs_put_lseg(hdr->lseg); 1592 pnfs_put_lseg(hdr->lseg);
1593 nfs_rw_header_free(hdr); 1593 nfs_pgio_header_free(hdr);
1594} 1594}
1595EXPORT_SYMBOL_GPL(pnfs_writehdr_free); 1595EXPORT_SYMBOL_GPL(pnfs_writehdr_free);
1596 1596
1597int 1597int
1598pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) 1598pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
1599{ 1599{
1600 struct nfs_rw_header *whdr;
1601 struct nfs_pgio_header *hdr; 1600 struct nfs_pgio_header *hdr;
1602 int ret; 1601 int ret;
1603 1602
1604 whdr = nfs_rw_header_alloc(desc->pg_rw_ops); 1603 hdr = nfs_pgio_header_alloc(desc->pg_rw_ops);
1605 if (!whdr) { 1604 if (!hdr) {
1606 desc->pg_completion_ops->error_cleanup(&desc->pg_list); 1605 desc->pg_completion_ops->error_cleanup(&desc->pg_list);
1607 pnfs_put_lseg(desc->pg_lseg); 1606 pnfs_put_lseg(desc->pg_lseg);
1608 desc->pg_lseg = NULL; 1607 desc->pg_lseg = NULL;
1609 return -ENOMEM; 1608 return -ENOMEM;
1610 } 1609 }
1611 hdr = &whdr->header;
1612 nfs_pgheader_init(desc, hdr, pnfs_writehdr_free); 1610 nfs_pgheader_init(desc, hdr, pnfs_writehdr_free);
1613 hdr->lseg = pnfs_get_lseg(desc->pg_lseg); 1611 hdr->lseg = pnfs_get_lseg(desc->pg_lseg);
1614 atomic_inc(&hdr->refcnt); 1612 atomic_inc(&hdr->refcnt);
@@ -1696,7 +1694,7 @@ pnfs_read_through_mds(struct nfs_pageio_descriptor *desc,
1696 nfs_pageio_reset_read_mds(desc); 1694 nfs_pageio_reset_read_mds(desc);
1697 desc->pg_recoalesce = 1; 1695 desc->pg_recoalesce = 1;
1698 } 1696 }
1699 nfs_pgio_data_release(data); 1697 nfs_pgio_data_destroy(data);
1700} 1698}
1701 1699
1702/* 1700/*
@@ -1727,7 +1725,7 @@ pnfs_try_to_read_data(struct nfs_pgio_data *rdata,
1727static void 1725static void
1728pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) 1726pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr)
1729{ 1727{
1730 struct nfs_pgio_data *data = hdr->data; 1728 struct nfs_pgio_data *data = &hdr->data;
1731 const struct rpc_call_ops *call_ops = desc->pg_rpc_callops; 1729 const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
1732 struct pnfs_layout_segment *lseg = desc->pg_lseg; 1730 struct pnfs_layout_segment *lseg = desc->pg_lseg;
1733 enum pnfs_try_status trypnfs; 1731 enum pnfs_try_status trypnfs;
@@ -1742,26 +1740,24 @@ pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr)
1742static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) 1740static void pnfs_readhdr_free(struct nfs_pgio_header *hdr)
1743{ 1741{
1744 pnfs_put_lseg(hdr->lseg); 1742 pnfs_put_lseg(hdr->lseg);
1745 nfs_rw_header_free(hdr); 1743 nfs_pgio_header_free(hdr);
1746} 1744}
1747EXPORT_SYMBOL_GPL(pnfs_readhdr_free); 1745EXPORT_SYMBOL_GPL(pnfs_readhdr_free);
1748 1746
1749int 1747int
1750pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) 1748pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc)
1751{ 1749{
1752 struct nfs_rw_header *rhdr;
1753 struct nfs_pgio_header *hdr; 1750 struct nfs_pgio_header *hdr;
1754 int ret; 1751 int ret;
1755 1752
1756 rhdr = nfs_rw_header_alloc(desc->pg_rw_ops); 1753 hdr = nfs_pgio_header_alloc(desc->pg_rw_ops);
1757 if (!rhdr) { 1754 if (!hdr) {
1758 desc->pg_completion_ops->error_cleanup(&desc->pg_list); 1755 desc->pg_completion_ops->error_cleanup(&desc->pg_list);
1759 ret = -ENOMEM; 1756 ret = -ENOMEM;
1760 pnfs_put_lseg(desc->pg_lseg); 1757 pnfs_put_lseg(desc->pg_lseg);
1761 desc->pg_lseg = NULL; 1758 desc->pg_lseg = NULL;
1762 return ret; 1759 return ret;
1763 } 1760 }
1764 hdr = &rhdr->header;
1765 nfs_pgheader_init(desc, hdr, pnfs_readhdr_free); 1761 nfs_pgheader_init(desc, hdr, pnfs_readhdr_free);
1766 hdr->lseg = pnfs_get_lseg(desc->pg_lseg); 1762 hdr->lseg = pnfs_get_lseg(desc->pg_lseg);
1767 atomic_inc(&hdr->refcnt); 1763 atomic_inc(&hdr->refcnt);