diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-18 20:51:13 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:07 -0400 |
commit | 70c3bd2bdf9a3c7c9282c362a4ec9ec88c713e13 (patch) | |
tree | cd1bbe74ec866d820b344b3d6d4c4c25e4c2e960 /fs/nfs/pnfs.c | |
parent | 49a85061b0bc9cb26361096482c81172c666c937 (diff) |
NFSv4.1: Cleanup; add "pnfs_" prefix to get_layout_hdr() and put_layout_hdr()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index aea2e5256fe4..512c8632bf36 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -190,7 +190,7 @@ EXPORT_SYMBOL_GPL(pnfs_unregister_layoutdriver); | |||
190 | 190 | ||
191 | /* Need to hold i_lock if caller does not already hold reference */ | 191 | /* Need to hold i_lock if caller does not already hold reference */ |
192 | void | 192 | void |
193 | get_layout_hdr(struct pnfs_layout_hdr *lo) | 193 | pnfs_get_layout_hdr(struct pnfs_layout_hdr *lo) |
194 | { | 194 | { |
195 | atomic_inc(&lo->plh_refcount); | 195 | atomic_inc(&lo->plh_refcount); |
196 | } | 196 | } |
@@ -221,14 +221,14 @@ destroy_layout_hdr(struct pnfs_layout_hdr *lo) | |||
221 | } | 221 | } |
222 | 222 | ||
223 | static void | 223 | static void |
224 | put_layout_hdr_locked(struct pnfs_layout_hdr *lo) | 224 | pnfs_put_layout_hdr_locked(struct pnfs_layout_hdr *lo) |
225 | { | 225 | { |
226 | if (atomic_dec_and_test(&lo->plh_refcount)) | 226 | if (atomic_dec_and_test(&lo->plh_refcount)) |
227 | destroy_layout_hdr(lo); | 227 | destroy_layout_hdr(lo); |
228 | } | 228 | } |
229 | 229 | ||
230 | void | 230 | void |
231 | put_layout_hdr(struct pnfs_layout_hdr *lo) | 231 | pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo) |
232 | { | 232 | { |
233 | struct inode *inode = lo->plh_inode; | 233 | struct inode *inode = lo->plh_inode; |
234 | 234 | ||
@@ -254,8 +254,8 @@ static void free_lseg(struct pnfs_layout_segment *lseg) | |||
254 | struct inode *ino = lseg->pls_layout->plh_inode; | 254 | struct inode *ino = lseg->pls_layout->plh_inode; |
255 | 255 | ||
256 | NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); | 256 | NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); |
257 | /* Matched by get_layout_hdr in pnfs_insert_layout */ | 257 | /* Matched by pnfs_get_layout_hdr in pnfs_insert_layout */ |
258 | put_layout_hdr(NFS_I(ino)->layout); | 258 | pnfs_put_layout_hdr(NFS_I(ino)->layout); |
259 | } | 259 | } |
260 | 260 | ||
261 | static void | 261 | static void |
@@ -268,7 +268,7 @@ put_lseg_common(struct pnfs_layout_segment *lseg) | |||
268 | if (list_empty(&lseg->pls_layout->plh_segs)) { | 268 | if (list_empty(&lseg->pls_layout->plh_segs)) { |
269 | set_bit(NFS_LAYOUT_DESTROYED, &lseg->pls_layout->plh_flags); | 269 | set_bit(NFS_LAYOUT_DESTROYED, &lseg->pls_layout->plh_flags); |
270 | /* Matched by initial refcount set in alloc_init_layout_hdr */ | 270 | /* Matched by initial refcount set in alloc_init_layout_hdr */ |
271 | put_layout_hdr_locked(lseg->pls_layout); | 271 | pnfs_put_layout_hdr_locked(lseg->pls_layout); |
272 | } | 272 | } |
273 | rpc_wake_up(&NFS_SERVER(inode)->roc_rpcwaitq); | 273 | rpc_wake_up(&NFS_SERVER(inode)->roc_rpcwaitq); |
274 | } | 274 | } |
@@ -404,7 +404,7 @@ pnfs_mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo, | |||
404 | NFS_I(lo->plh_inode)->write_io = 0; | 404 | NFS_I(lo->plh_inode)->write_io = 0; |
405 | NFS_I(lo->plh_inode)->read_io = 0; | 405 | NFS_I(lo->plh_inode)->read_io = 0; |
406 | if (!test_and_set_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags)) | 406 | if (!test_and_set_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags)) |
407 | put_layout_hdr_locked(lo); | 407 | pnfs_put_layout_hdr_locked(lo); |
408 | return 0; | 408 | return 0; |
409 | } | 409 | } |
410 | list_for_each_entry_safe(lseg, next, &lo->plh_segs, pls_list) | 410 | list_for_each_entry_safe(lseg, next, &lo->plh_segs, pls_list) |
@@ -649,13 +649,13 @@ _pnfs_return_layout(struct inode *ino) | |||
649 | } | 649 | } |
650 | stateid = nfsi->layout->plh_stateid; | 650 | stateid = nfsi->layout->plh_stateid; |
651 | /* Reference matched in nfs4_layoutreturn_release */ | 651 | /* Reference matched in nfs4_layoutreturn_release */ |
652 | get_layout_hdr(lo); | 652 | pnfs_get_layout_hdr(lo); |
653 | empty = list_empty(&lo->plh_segs); | 653 | empty = list_empty(&lo->plh_segs); |
654 | pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL); | 654 | pnfs_mark_matching_lsegs_invalid(lo, &tmp_list, NULL); |
655 | /* Don't send a LAYOUTRETURN if list was initially empty */ | 655 | /* Don't send a LAYOUTRETURN if list was initially empty */ |
656 | if (empty) { | 656 | if (empty) { |
657 | spin_unlock(&ino->i_lock); | 657 | spin_unlock(&ino->i_lock); |
658 | put_layout_hdr(lo); | 658 | pnfs_put_layout_hdr(lo); |
659 | dprintk("NFS: %s no layout segments to return\n", __func__); | 659 | dprintk("NFS: %s no layout segments to return\n", __func__); |
660 | goto out; | 660 | goto out; |
661 | } | 661 | } |
@@ -672,7 +672,7 @@ _pnfs_return_layout(struct inode *ino) | |||
672 | set_bit(NFS_LAYOUT_RW_FAILED, &lo->plh_flags); | 672 | set_bit(NFS_LAYOUT_RW_FAILED, &lo->plh_flags); |
673 | set_bit(NFS_LAYOUT_RO_FAILED, &lo->plh_flags); | 673 | set_bit(NFS_LAYOUT_RO_FAILED, &lo->plh_flags); |
674 | pnfs_clear_layout_returned(lo); | 674 | pnfs_clear_layout_returned(lo); |
675 | put_layout_hdr(lo); | 675 | pnfs_put_layout_hdr(lo); |
676 | goto out; | 676 | goto out; |
677 | } | 677 | } |
678 | 678 | ||
@@ -709,7 +709,7 @@ bool pnfs_roc(struct inode *ino) | |||
709 | if (!found) | 709 | if (!found) |
710 | goto out_nolayout; | 710 | goto out_nolayout; |
711 | lo->plh_block_lgets++; | 711 | lo->plh_block_lgets++; |
712 | get_layout_hdr(lo); /* matched in pnfs_roc_release */ | 712 | pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */ |
713 | spin_unlock(&ino->i_lock); | 713 | spin_unlock(&ino->i_lock); |
714 | pnfs_free_lseg_list(&tmp_list); | 714 | pnfs_free_lseg_list(&tmp_list); |
715 | return true; | 715 | return true; |
@@ -726,7 +726,7 @@ void pnfs_roc_release(struct inode *ino) | |||
726 | spin_lock(&ino->i_lock); | 726 | spin_lock(&ino->i_lock); |
727 | lo = NFS_I(ino)->layout; | 727 | lo = NFS_I(ino)->layout; |
728 | lo->plh_block_lgets--; | 728 | lo->plh_block_lgets--; |
729 | put_layout_hdr_locked(lo); | 729 | pnfs_put_layout_hdr_locked(lo); |
730 | spin_unlock(&ino->i_lock); | 730 | spin_unlock(&ino->i_lock); |
731 | } | 731 | } |
732 | 732 | ||
@@ -819,7 +819,7 @@ pnfs_insert_layout(struct pnfs_layout_hdr *lo, | |||
819 | __func__, lseg, lseg->pls_range.iomode, | 819 | __func__, lseg, lseg->pls_range.iomode, |
820 | lseg->pls_range.offset, lseg->pls_range.length); | 820 | lseg->pls_range.offset, lseg->pls_range.length); |
821 | out: | 821 | out: |
822 | get_layout_hdr(lo); | 822 | pnfs_get_layout_hdr(lo); |
823 | 823 | ||
824 | dprintk("%s:Return\n", __func__); | 824 | dprintk("%s:Return\n", __func__); |
825 | } | 825 | } |
@@ -1058,7 +1058,7 @@ pnfs_update_layout(struct inode *ino, | |||
1058 | goto out_unlock; | 1058 | goto out_unlock; |
1059 | atomic_inc(&lo->plh_outstanding); | 1059 | atomic_inc(&lo->plh_outstanding); |
1060 | 1060 | ||
1061 | get_layout_hdr(lo); | 1061 | pnfs_get_layout_hdr(lo); |
1062 | if (list_empty(&lo->plh_segs)) | 1062 | if (list_empty(&lo->plh_segs)) |
1063 | first = true; | 1063 | first = true; |
1064 | 1064 | ||
@@ -1091,7 +1091,7 @@ pnfs_update_layout(struct inode *ino, | |||
1091 | spin_unlock(&clp->cl_lock); | 1091 | spin_unlock(&clp->cl_lock); |
1092 | } | 1092 | } |
1093 | atomic_dec(&lo->plh_outstanding); | 1093 | atomic_dec(&lo->plh_outstanding); |
1094 | put_layout_hdr(lo); | 1094 | pnfs_put_layout_hdr(lo); |
1095 | out: | 1095 | out: |
1096 | dprintk("%s end, state 0x%lx lseg %p\n", __func__, | 1096 | dprintk("%s end, state 0x%lx lseg %p\n", __func__, |
1097 | nfsi->layout ? nfsi->layout->plh_flags : -1, lseg); | 1097 | nfsi->layout ? nfsi->layout->plh_flags : -1, lseg); |