aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/callback_proc.c8
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/pnfs.c30
-rw-r--r--fs/nfs/pnfs.h4
4 files changed, 22 insertions, 22 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 57b8bda0f4e9..24252fea2c9c 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -122,7 +122,7 @@ static struct pnfs_layout_hdr * get_layout_by_fh_locked(struct nfs_client *clp,
122 ino = igrab(lo->plh_inode); 122 ino = igrab(lo->plh_inode);
123 if (!ino) 123 if (!ino)
124 continue; 124 continue;
125 get_layout_hdr(lo); 125 pnfs_get_layout_hdr(lo);
126 return lo; 126 return lo;
127 } 127 }
128 } 128 }
@@ -166,7 +166,7 @@ static u32 initiate_file_draining(struct nfs_client *clp,
166 pnfs_set_layout_stateid(lo, &args->cbl_stateid, true); 166 pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
167 spin_unlock(&ino->i_lock); 167 spin_unlock(&ino->i_lock);
168 pnfs_free_lseg_list(&free_me_list); 168 pnfs_free_lseg_list(&free_me_list);
169 put_layout_hdr(lo); 169 pnfs_put_layout_hdr(lo);
170 iput(ino); 170 iput(ino);
171 return rv; 171 return rv;
172} 172}
@@ -198,7 +198,7 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
198 list_for_each_entry(lo, &server->layouts, plh_layouts) { 198 list_for_each_entry(lo, &server->layouts, plh_layouts) {
199 if (!igrab(lo->plh_inode)) 199 if (!igrab(lo->plh_inode))
200 continue; 200 continue;
201 get_layout_hdr(lo); 201 pnfs_get_layout_hdr(lo);
202 BUG_ON(!list_empty(&lo->plh_bulk_recall)); 202 BUG_ON(!list_empty(&lo->plh_bulk_recall));
203 list_add(&lo->plh_bulk_recall, &recall_list); 203 list_add(&lo->plh_bulk_recall, &recall_list);
204 } 204 }
@@ -216,7 +216,7 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
216 list_del_init(&lo->plh_bulk_recall); 216 list_del_init(&lo->plh_bulk_recall);
217 spin_unlock(&ino->i_lock); 217 spin_unlock(&ino->i_lock);
218 pnfs_free_lseg_list(&free_me_list); 218 pnfs_free_lseg_list(&free_me_list);
219 put_layout_hdr(lo); 219 pnfs_put_layout_hdr(lo);
220 iput(ino); 220 iput(ino);
221 } 221 }
222 return rv; 222 return rv;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1c8656f8745c..bdacb8c21a33 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6375,7 +6375,7 @@ static void nfs4_layoutreturn_release(void *calldata)
6375 struct nfs4_layoutreturn *lrp = calldata; 6375 struct nfs4_layoutreturn *lrp = calldata;
6376 6376
6377 dprintk("--> %s\n", __func__); 6377 dprintk("--> %s\n", __func__);
6378 put_layout_hdr(lrp->args.layout); 6378 pnfs_put_layout_hdr(lrp->args.layout);
6379 kfree(calldata); 6379 kfree(calldata);
6380 dprintk("<-- %s\n", __func__); 6380 dprintk("<-- %s\n", __func__);
6381} 6381}
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 */
192void 192void
193get_layout_hdr(struct pnfs_layout_hdr *lo) 193pnfs_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
223static void 223static void
224put_layout_hdr_locked(struct pnfs_layout_hdr *lo) 224pnfs_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
230void 230void
231put_layout_hdr(struct pnfs_layout_hdr *lo) 231pnfs_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
261static void 261static 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);
821out: 821out:
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);
1095out: 1095out:
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);
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 6af518934e4c..2af681f0a491 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -176,7 +176,7 @@ extern struct pnfs_layout_segment* nfs4_proc_layoutget(struct nfs4_layoutget *lg
176extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp); 176extern int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp);
177 177
178/* pnfs.c */ 178/* pnfs.c */
179void get_layout_hdr(struct pnfs_layout_hdr *lo); 179void pnfs_get_layout_hdr(struct pnfs_layout_hdr *lo);
180void put_lseg(struct pnfs_layout_segment *lseg); 180void put_lseg(struct pnfs_layout_segment *lseg);
181 181
182void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *, 182void pnfs_pageio_init_read(struct nfs_pageio_descriptor *, struct inode *,
@@ -196,7 +196,7 @@ struct pnfs_layout_segment *pnfs_layout_process(struct nfs4_layoutget *lgp);
196void pnfs_free_lseg_list(struct list_head *tmp_list); 196void pnfs_free_lseg_list(struct list_head *tmp_list);
197void pnfs_destroy_layout(struct nfs_inode *); 197void pnfs_destroy_layout(struct nfs_inode *);
198void pnfs_destroy_all_layouts(struct nfs_client *); 198void pnfs_destroy_all_layouts(struct nfs_client *);
199void put_layout_hdr(struct pnfs_layout_hdr *lo); 199void pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo);
200void pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, 200void pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo,
201 const nfs4_stateid *new, 201 const nfs4_stateid *new,
202 bool update_barrier); 202 bool update_barrier);