diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-18 20:57:08 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:07 -0400 |
commit | 9369a431bce1e985597eda32992960c969b27c5b (patch) | |
tree | 09e566777480749f44c54c642f5d31d8b91e9d44 /fs/nfs | |
parent | 70c3bd2bdf9a3c7c9282c362a4ec9ec88c713e13 (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')
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 16 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 36 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 8 |
4 files changed, 31 insertions, 31 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 53f94d915bd1..77cd1151ef0d 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -453,7 +453,7 @@ static void filelayout_commit_release(void *calldata) | |||
453 | struct nfs_commit_data *data = calldata; | 453 | struct nfs_commit_data *data = calldata; |
454 | 454 | ||
455 | data->completion_ops->completion(data); | 455 | data->completion_ops->completion(data); |
456 | put_lseg(data->lseg); | 456 | pnfs_put_lseg(data->lseg); |
457 | nfs_put_client(data->ds_clp); | 457 | nfs_put_client(data->ds_clp); |
458 | nfs_commitdata_release(data); | 458 | nfs_commitdata_release(data); |
459 | } | 459 | } |
@@ -931,7 +931,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio, | |||
931 | nfs_init_cinfo(&cinfo, pgio->pg_inode, pgio->pg_dreq); | 931 | nfs_init_cinfo(&cinfo, pgio->pg_inode, pgio->pg_dreq); |
932 | status = filelayout_alloc_commit_info(pgio->pg_lseg, &cinfo, GFP_NOFS); | 932 | status = filelayout_alloc_commit_info(pgio->pg_lseg, &cinfo, GFP_NOFS); |
933 | if (status < 0) { | 933 | if (status < 0) { |
934 | put_lseg(pgio->pg_lseg); | 934 | pnfs_put_lseg(pgio->pg_lseg); |
935 | pgio->pg_lseg = NULL; | 935 | pgio->pg_lseg = NULL; |
936 | goto out_mds; | 936 | goto out_mds; |
937 | } | 937 | } |
@@ -985,7 +985,7 @@ filelayout_clear_request_commit(struct nfs_page *req, | |||
985 | out: | 985 | out: |
986 | nfs_request_remove_commit_list(req, cinfo); | 986 | nfs_request_remove_commit_list(req, cinfo); |
987 | spin_unlock(cinfo->lock); | 987 | spin_unlock(cinfo->lock); |
988 | put_lseg(freeme); | 988 | pnfs_put_lseg(freeme); |
989 | } | 989 | } |
990 | 990 | ||
991 | static struct list_head * | 991 | static struct list_head * |
@@ -1018,7 +1018,7 @@ filelayout_choose_commit_list(struct nfs_page *req, | |||
1018 | * off due to a rewrite, in which case it will be done in | 1018 | * off due to a rewrite, in which case it will be done in |
1019 | * filelayout_clear_request_commit | 1019 | * filelayout_clear_request_commit |
1020 | */ | 1020 | */ |
1021 | buckets[i].wlseg = get_lseg(lseg); | 1021 | buckets[i].wlseg = pnfs_get_lseg(lseg); |
1022 | } | 1022 | } |
1023 | set_bit(PG_COMMIT_TO_DS, &req->wb_flags); | 1023 | set_bit(PG_COMMIT_TO_DS, &req->wb_flags); |
1024 | cinfo->ds->nwritten++; | 1024 | cinfo->ds->nwritten++; |
@@ -1128,7 +1128,7 @@ filelayout_scan_ds_commit_list(struct pnfs_commit_bucket *bucket, | |||
1128 | if (list_empty(src)) | 1128 | if (list_empty(src)) |
1129 | bucket->wlseg = NULL; | 1129 | bucket->wlseg = NULL; |
1130 | else | 1130 | else |
1131 | get_lseg(bucket->clseg); | 1131 | pnfs_get_lseg(bucket->clseg); |
1132 | } | 1132 | } |
1133 | return ret; | 1133 | return ret; |
1134 | } | 1134 | } |
@@ -1159,12 +1159,12 @@ static void filelayout_recover_commit_reqs(struct list_head *dst, | |||
1159 | 1159 | ||
1160 | /* NOTE cinfo->lock is NOT held, relying on fact that this is | 1160 | /* NOTE cinfo->lock is NOT held, relying on fact that this is |
1161 | * only called on single thread per dreq. | 1161 | * only called on single thread per dreq. |
1162 | * Can't take the lock because need to do put_lseg | 1162 | * Can't take the lock because need to do pnfs_put_lseg |
1163 | */ | 1163 | */ |
1164 | for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { | 1164 | for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { |
1165 | if (transfer_commit_list(&b->written, dst, cinfo, 0)) { | 1165 | if (transfer_commit_list(&b->written, dst, cinfo, 0)) { |
1166 | BUG_ON(!list_empty(&b->written)); | 1166 | BUG_ON(!list_empty(&b->written)); |
1167 | put_lseg(b->wlseg); | 1167 | pnfs_put_lseg(b->wlseg); |
1168 | b->wlseg = NULL; | 1168 | b->wlseg = NULL; |
1169 | } | 1169 | } |
1170 | } | 1170 | } |
@@ -1200,7 +1200,7 @@ alloc_ds_commits(struct nfs_commit_info *cinfo, struct list_head *list) | |||
1200 | if (list_empty(&bucket->committing)) | 1200 | if (list_empty(&bucket->committing)) |
1201 | continue; | 1201 | continue; |
1202 | nfs_retry_commit(&bucket->committing, bucket->clseg, cinfo); | 1202 | nfs_retry_commit(&bucket->committing, bucket->clseg, cinfo); |
1203 | put_lseg(bucket->clseg); | 1203 | pnfs_put_lseg(bucket->clseg); |
1204 | bucket->clseg = NULL; | 1204 | bucket->clseg = NULL; |
1205 | } | 1205 | } |
1206 | /* Caller will clean up entries put on list */ | 1206 | /* Caller will clean up entries put on list */ |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index bdacb8c21a33..e605d417a006 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6549,7 +6549,7 @@ static void nfs4_layoutcommit_release(void *calldata) | |||
6549 | list_del_init(&lseg->pls_lc_list); | 6549 | list_del_init(&lseg->pls_lc_list); |
6550 | if (test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT, | 6550 | if (test_and_clear_bit(NFS_LSEG_LAYOUTCOMMIT, |
6551 | &lseg->pls_flags)) | 6551 | &lseg->pls_flags)) |
6552 | put_lseg(lseg); | 6552 | pnfs_put_lseg(lseg); |
6553 | } | 6553 | } |
6554 | 6554 | ||
6555 | clear_bit_unlock(NFS_INO_LAYOUTCOMMITTING, bitlock); | 6555 | clear_bit_unlock(NFS_INO_LAYOUTCOMMITTING, bitlock); |
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 | ||
261 | static void | 261 | static void |
262 | put_lseg_common(struct pnfs_layout_segment *lseg) | 262 | pnfs_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 | ||
276 | void | 276 | void |
277 | put_lseg(struct pnfs_layout_segment *lseg) | 277 | pnfs_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 | } |
297 | EXPORT_SYMBOL_GPL(put_lseg); | 297 | EXPORT_SYMBOL_GPL(pnfs_put_lseg); |
298 | 298 | ||
299 | static inline u64 | 299 | static inline u64 |
300 | end_offset(u64 start, u64 len) | 300 | end_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 | ||
1375 | static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) | 1375 | static 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 | } |
1380 | EXPORT_SYMBOL_GPL(pnfs_writehdr_free); | 1380 | EXPORT_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 | ||
1530 | static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) | 1530 | static 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 | } |
1535 | EXPORT_SYMBOL_GPL(pnfs_readhdr_free); | 1535 | EXPORT_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; |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 2af681f0a491..04958797fad0 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -177,7 +177,7 @@ extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp); | |||
177 | 177 | ||
178 | /* pnfs.c */ | 178 | /* pnfs.c */ |
179 | void pnfs_get_layout_hdr(struct pnfs_layout_hdr *lo); | 179 | void pnfs_get_layout_hdr(struct pnfs_layout_hdr *lo); |
180 | void put_lseg(struct pnfs_layout_segment *lseg); | 180 | void pnfs_put_lseg(struct pnfs_layout_segment *lseg); |
181 | 181 | ||
182 | void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *, | 182 | void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *, |
183 | const struct nfs_pgio_completion_ops *); | 183 | const struct nfs_pgio_completion_ops *); |
@@ -281,7 +281,7 @@ static inline int lo_fail_bit(u32 iomode) | |||
281 | } | 281 | } |
282 | 282 | ||
283 | static inline struct pnfs_layout_segment * | 283 | static inline struct pnfs_layout_segment * |
284 | get_lseg(struct pnfs_layout_segment *lseg) | 284 | pnfs_get_lseg(struct pnfs_layout_segment *lseg) |
285 | { | 285 | { |
286 | if (lseg) { | 286 | if (lseg) { |
287 | atomic_inc(&lseg->pls_refcount); | 287 | atomic_inc(&lseg->pls_refcount); |
@@ -406,12 +406,12 @@ static inline void pnfs_destroy_layout(struct nfs_inode *nfsi) | |||
406 | } | 406 | } |
407 | 407 | ||
408 | static inline struct pnfs_layout_segment * | 408 | static inline struct pnfs_layout_segment * |
409 | get_lseg(struct pnfs_layout_segment *lseg) | 409 | pnfs_get_lseg(struct pnfs_layout_segment *lseg) |
410 | { | 410 | { |
411 | return NULL; | 411 | return NULL; |
412 | } | 412 | } |
413 | 413 | ||
414 | static inline void put_lseg(struct pnfs_layout_segment *lseg) | 414 | static inline void pnfs_put_lseg(struct pnfs_layout_segment *lseg) |
415 | { | 415 | { |
416 | } | 416 | } |
417 | 417 | ||