aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-18 20:57:08 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:07 -0400
commit9369a431bce1e985597eda32992960c969b27c5b (patch)
tree09e566777480749f44c54c642f5d31d8b91e9d44 /fs/nfs/pnfs.c
parent70c3bd2bdf9a3c7c9282c362a4ec9ec88c713e13 (diff)
NFSv4.1: Cleanup; add "pnfs_" prefix to put_lseg() and get_lseg()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 512c8632bf36..498af8779959 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -259,7 +259,7 @@ static void free_lseg(struct pnfs_layout_segment *lseg)
259} 259}
260 260
261static void 261static void
262put_lseg_common(struct pnfs_layout_segment *lseg) 262pnfs_put_lseg_common(struct pnfs_layout_segment *lseg)
263{ 263{
264 struct inode *inode = lseg->pls_layout->plh_inode; 264 struct inode *inode = lseg->pls_layout->plh_inode;
265 265
@@ -274,7 +274,7 @@ put_lseg_common(struct pnfs_layout_segment *lseg)
274} 274}
275 275
276void 276void
277put_lseg(struct pnfs_layout_segment *lseg) 277pnfs_put_lseg(struct pnfs_layout_segment *lseg)
278{ 278{
279 struct inode *inode; 279 struct inode *inode;
280 280
@@ -288,13 +288,13 @@ put_lseg(struct pnfs_layout_segment *lseg)
288 if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) { 288 if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) {
289 LIST_HEAD(free_me); 289 LIST_HEAD(free_me);
290 290
291 put_lseg_common(lseg); 291 pnfs_put_lseg_common(lseg);
292 list_add(&lseg->pls_list, &free_me); 292 list_add(&lseg->pls_list, &free_me);
293 spin_unlock(&inode->i_lock); 293 spin_unlock(&inode->i_lock);
294 pnfs_free_lseg_list(&free_me); 294 pnfs_free_lseg_list(&free_me);
295 } 295 }
296} 296}
297EXPORT_SYMBOL_GPL(put_lseg); 297EXPORT_SYMBOL_GPL(pnfs_put_lseg);
298 298
299static inline u64 299static inline u64
300end_offset(u64 start, u64 len) 300end_offset(u64 start, u64 len)
@@ -378,7 +378,7 @@ static int mark_lseg_invalid(struct pnfs_layout_segment *lseg,
378 dprintk("%s: lseg %p ref %d\n", __func__, lseg, 378 dprintk("%s: lseg %p ref %d\n", __func__, lseg,
379 atomic_read(&lseg->pls_refcount)); 379 atomic_read(&lseg->pls_refcount));
380 if (atomic_dec_and_test(&lseg->pls_refcount)) { 380 if (atomic_dec_and_test(&lseg->pls_refcount)) {
381 put_lseg_common(lseg); 381 pnfs_put_lseg_common(lseg);
382 list_add(&lseg->pls_list, tmp_list); 382 list_add(&lseg->pls_list, tmp_list);
383 rv = 1; 383 rv = 1;
384 } 384 }
@@ -914,7 +914,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
914 list_for_each_entry(lseg, &lo->plh_segs, pls_list) { 914 list_for_each_entry(lseg, &lo->plh_segs, pls_list) {
915 if (test_bit(NFS_LSEG_VALID, &lseg->pls_flags) && 915 if (test_bit(NFS_LSEG_VALID, &lseg->pls_flags) &&
916 is_matching_lseg(&lseg->pls_range, range)) { 916 is_matching_lseg(&lseg->pls_range, range)) {
917 ret = get_lseg(lseg); 917 ret = pnfs_get_lseg(lseg);
918 break; 918 break;
919 } 919 }
920 if (lseg->pls_range.offset > range->offset) 920 if (lseg->pls_range.offset > range->offset)
@@ -1135,7 +1135,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
1135 } 1135 }
1136 init_lseg(lo, lseg); 1136 init_lseg(lo, lseg);
1137 lseg->pls_range = res->range; 1137 lseg->pls_range = res->range;
1138 get_lseg(lseg); 1138 pnfs_get_lseg(lseg);
1139 pnfs_insert_layout(lo, lseg); 1139 pnfs_insert_layout(lo, lseg);
1140 1140
1141 if (res->return_on_close) { 1141 if (res->return_on_close) {
@@ -1369,12 +1369,12 @@ pnfs_do_multiple_writes(struct nfs_pageio_descriptor *desc, struct list_head *he
1369 if (trypnfs == PNFS_NOT_ATTEMPTED) 1369 if (trypnfs == PNFS_NOT_ATTEMPTED)
1370 pnfs_write_through_mds(desc, data); 1370 pnfs_write_through_mds(desc, data);
1371 } 1371 }
1372 put_lseg(lseg); 1372 pnfs_put_lseg(lseg);
1373} 1373}
1374 1374
1375static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) 1375static void pnfs_writehdr_free(struct nfs_pgio_header *hdr)
1376{ 1376{
1377 put_lseg(hdr->lseg); 1377 pnfs_put_lseg(hdr->lseg);
1378 nfs_writehdr_free(hdr); 1378 nfs_writehdr_free(hdr);
1379} 1379}
1380EXPORT_SYMBOL_GPL(pnfs_writehdr_free); 1380EXPORT_SYMBOL_GPL(pnfs_writehdr_free);
@@ -1389,17 +1389,17 @@ pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc)
1389 whdr = nfs_writehdr_alloc(); 1389 whdr = nfs_writehdr_alloc();
1390 if (!whdr) { 1390 if (!whdr) {
1391 desc->pg_completion_ops->error_cleanup(&desc->pg_list); 1391 desc->pg_completion_ops->error_cleanup(&desc->pg_list);
1392 put_lseg(desc->pg_lseg); 1392 pnfs_put_lseg(desc->pg_lseg);
1393 desc->pg_lseg = NULL; 1393 desc->pg_lseg = NULL;
1394 return -ENOMEM; 1394 return -ENOMEM;
1395 } 1395 }
1396 hdr = &whdr->header; 1396 hdr = &whdr->header;
1397 nfs_pgheader_init(desc, hdr, pnfs_writehdr_free); 1397 nfs_pgheader_init(desc, hdr, pnfs_writehdr_free);
1398 hdr->lseg = get_lseg(desc->pg_lseg); 1398 hdr->lseg = pnfs_get_lseg(desc->pg_lseg);
1399 atomic_inc(&hdr->refcnt); 1399 atomic_inc(&hdr->refcnt);
1400 ret = nfs_generic_flush(desc, hdr); 1400 ret = nfs_generic_flush(desc, hdr);
1401 if (ret != 0) { 1401 if (ret != 0) {
1402 put_lseg(desc->pg_lseg); 1402 pnfs_put_lseg(desc->pg_lseg);
1403 desc->pg_lseg = NULL; 1403 desc->pg_lseg = NULL;
1404 } else 1404 } else
1405 pnfs_do_multiple_writes(desc, &hdr->rpc_list, desc->pg_ioflags); 1405 pnfs_do_multiple_writes(desc, &hdr->rpc_list, desc->pg_ioflags);
@@ -1524,12 +1524,12 @@ pnfs_do_multiple_reads(struct nfs_pageio_descriptor *desc, struct list_head *hea
1524 if (trypnfs == PNFS_NOT_ATTEMPTED) 1524 if (trypnfs == PNFS_NOT_ATTEMPTED)
1525 pnfs_read_through_mds(desc, data); 1525 pnfs_read_through_mds(desc, data);
1526 } 1526 }
1527 put_lseg(lseg); 1527 pnfs_put_lseg(lseg);
1528} 1528}
1529 1529
1530static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) 1530static void pnfs_readhdr_free(struct nfs_pgio_header *hdr)
1531{ 1531{
1532 put_lseg(hdr->lseg); 1532 pnfs_put_lseg(hdr->lseg);
1533 nfs_readhdr_free(hdr); 1533 nfs_readhdr_free(hdr);
1534} 1534}
1535EXPORT_SYMBOL_GPL(pnfs_readhdr_free); 1535EXPORT_SYMBOL_GPL(pnfs_readhdr_free);
@@ -1545,17 +1545,17 @@ pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc)
1545 if (!rhdr) { 1545 if (!rhdr) {
1546 desc->pg_completion_ops->error_cleanup(&desc->pg_list); 1546 desc->pg_completion_ops->error_cleanup(&desc->pg_list);
1547 ret = -ENOMEM; 1547 ret = -ENOMEM;
1548 put_lseg(desc->pg_lseg); 1548 pnfs_put_lseg(desc->pg_lseg);
1549 desc->pg_lseg = NULL; 1549 desc->pg_lseg = NULL;
1550 return ret; 1550 return ret;
1551 } 1551 }
1552 hdr = &rhdr->header; 1552 hdr = &rhdr->header;
1553 nfs_pgheader_init(desc, hdr, pnfs_readhdr_free); 1553 nfs_pgheader_init(desc, hdr, pnfs_readhdr_free);
1554 hdr->lseg = get_lseg(desc->pg_lseg); 1554 hdr->lseg = pnfs_get_lseg(desc->pg_lseg);
1555 atomic_inc(&hdr->refcnt); 1555 atomic_inc(&hdr->refcnt);
1556 ret = nfs_generic_pagein(desc, hdr); 1556 ret = nfs_generic_pagein(desc, hdr);
1557 if (ret != 0) { 1557 if (ret != 0) {
1558 put_lseg(desc->pg_lseg); 1558 pnfs_put_lseg(desc->pg_lseg);
1559 desc->pg_lseg = NULL; 1559 desc->pg_lseg = NULL;
1560 } else 1560 } else
1561 pnfs_do_multiple_reads(desc, &hdr->rpc_list); 1561 pnfs_do_multiple_reads(desc, &hdr->rpc_list);
@@ -1608,7 +1608,7 @@ pnfs_set_layoutcommit(struct nfs_write_data *wdata)
1608 } 1608 }
1609 if (!test_and_set_bit(NFS_LSEG_LAYOUTCOMMIT, &hdr->lseg->pls_flags)) { 1609 if (!test_and_set_bit(NFS_LSEG_LAYOUTCOMMIT, &hdr->lseg->pls_flags)) {
1610 /* references matched in nfs4_layoutcommit_release */ 1610 /* references matched in nfs4_layoutcommit_release */
1611 get_lseg(hdr->lseg); 1611 pnfs_get_lseg(hdr->lseg);
1612 } 1612 }
1613 if (end_pos > nfsi->layout->plh_lwb) 1613 if (end_pos > nfsi->layout->plh_lwb)
1614 nfsi->layout->plh_lwb = end_pos; 1614 nfsi->layout->plh_lwb = end_pos;