aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-01-06 06:36:20 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:31 -0500
commit566052c53b5146e23a99ab95fb5c11f8a295a084 (patch)
tree36c013aa52adf29bd57c2a04c9c51e24eeeb44b3 /fs/nfs
parentdaaa82d1c72e10dc16cad3a810e225f9188dc7aa (diff)
pnfs: add prefix to struct pnfs_layout_segment fields
While we are renaming all the fields, change lo->state to lo->plh_flags. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4filelayout.c2
-rw-r--r--fs/nfs/pnfs.c66
-rw-r--r--fs/nfs/pnfs.h10
3 files changed, 39 insertions, 39 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 2e92f0d8d654..738d6a4e77fe 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -243,7 +243,7 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
243static void 243static void
244filelayout_free_lseg(struct pnfs_layout_segment *lseg) 244filelayout_free_lseg(struct pnfs_layout_segment *lseg)
245{ 245{
246 struct nfs_server *nfss = NFS_SERVER(lseg->layout->inode); 246 struct nfs_server *nfss = NFS_SERVER(lseg->pls_layout->inode);
247 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg); 247 struct nfs4_filelayout_segment *fl = FILELAYOUT_LSEG(lseg);
248 248
249 dprintk("--> %s\n", __func__); 249 dprintk("--> %s\n", __func__);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 6e9daffa5a37..c3ca5fe1f3bd 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -210,9 +210,9 @@ put_layout_hdr(struct inode *inode)
210static void 210static void
211init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg) 211init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)
212{ 212{
213 INIT_LIST_HEAD(&lseg->fi_list); 213 INIT_LIST_HEAD(&lseg->pls_list);
214 kref_init(&lseg->kref); 214 kref_init(&lseg->pls_refcount);
215 lseg->layout = lo; 215 lseg->pls_layout = lo;
216} 216}
217 217
218/* Called without i_lock held, as the free_lseg call may sleep */ 218/* Called without i_lock held, as the free_lseg call may sleep */
@@ -220,8 +220,8 @@ static void
220destroy_lseg(struct kref *kref) 220destroy_lseg(struct kref *kref)
221{ 221{
222 struct pnfs_layout_segment *lseg = 222 struct pnfs_layout_segment *lseg =
223 container_of(kref, struct pnfs_layout_segment, kref); 223 container_of(kref, struct pnfs_layout_segment, pls_refcount);
224 struct inode *ino = lseg->layout->inode; 224 struct inode *ino = lseg->pls_layout->inode;
225 225
226 dprintk("--> %s\n", __func__); 226 dprintk("--> %s\n", __func__);
227 NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); 227 NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg);
@@ -236,8 +236,8 @@ put_lseg(struct pnfs_layout_segment *lseg)
236 return; 236 return;
237 237
238 dprintk("%s: lseg %p ref %d\n", __func__, lseg, 238 dprintk("%s: lseg %p ref %d\n", __func__, lseg,
239 atomic_read(&lseg->kref.refcount)); 239 atomic_read(&lseg->pls_refcount.refcount));
240 kref_put(&lseg->kref, destroy_lseg); 240 kref_put(&lseg->pls_refcount, destroy_lseg);
241} 241}
242 242
243static void 243static void
@@ -249,9 +249,9 @@ pnfs_clear_lseg_list(struct pnfs_layout_hdr *lo, struct list_head *tmp_list)
249 dprintk("%s:Begin lo %p\n", __func__, lo); 249 dprintk("%s:Begin lo %p\n", __func__, lo);
250 250
251 assert_spin_locked(&lo->inode->i_lock); 251 assert_spin_locked(&lo->inode->i_lock);
252 list_for_each_entry_safe(lseg, next, &lo->segs, fi_list) { 252 list_for_each_entry_safe(lseg, next, &lo->segs, pls_list) {
253 dprintk("%s: freeing lseg %p\n", __func__, lseg); 253 dprintk("%s: freeing lseg %p\n", __func__, lseg);
254 list_move(&lseg->fi_list, tmp_list); 254 list_move(&lseg->pls_list, tmp_list);
255 } 255 }
256 clp = NFS_SERVER(lo->inode)->nfs_client; 256 clp = NFS_SERVER(lo->inode)->nfs_client;
257 spin_lock(&clp->cl_lock); 257 spin_lock(&clp->cl_lock);
@@ -259,7 +259,7 @@ pnfs_clear_lseg_list(struct pnfs_layout_hdr *lo, struct list_head *tmp_list)
259 list_del_init(&lo->layouts); 259 list_del_init(&lo->layouts);
260 spin_unlock(&clp->cl_lock); 260 spin_unlock(&clp->cl_lock);
261 write_seqlock(&lo->seqlock); 261 write_seqlock(&lo->seqlock);
262 clear_bit(NFS_LAYOUT_STATEID_SET, &lo->state); 262 clear_bit(NFS_LAYOUT_STATEID_SET, &lo->plh_flags);
263 write_sequnlock(&lo->seqlock); 263 write_sequnlock(&lo->seqlock);
264 264
265 dprintk("%s:Return\n", __func__); 265 dprintk("%s:Return\n", __func__);
@@ -272,9 +272,9 @@ pnfs_free_lseg_list(struct list_head *tmp_list)
272 272
273 while (!list_empty(tmp_list)) { 273 while (!list_empty(tmp_list)) {
274 lseg = list_entry(tmp_list->next, struct pnfs_layout_segment, 274 lseg = list_entry(tmp_list->next, struct pnfs_layout_segment,
275 fi_list); 275 pls_list);
276 dprintk("%s calling put_lseg on %p\n", __func__, lseg); 276 dprintk("%s calling put_lseg on %p\n", __func__, lseg);
277 list_del(&lseg->fi_list); 277 list_del(&lseg->pls_list);
278 put_lseg(lseg); 278 put_lseg(lseg);
279 } 279 }
280} 280}
@@ -331,7 +331,7 @@ pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo,
331 bool overwrite = false; 331 bool overwrite = false;
332 332
333 write_seqlock(&lo->seqlock); 333 write_seqlock(&lo->seqlock);
334 if (!test_bit(NFS_LAYOUT_STATEID_SET, &lo->state) || 334 if (!test_bit(NFS_LAYOUT_STATEID_SET, &lo->plh_flags) ||
335 memcmp(old->stateid.other, new->stateid.other, sizeof(new->stateid.other))) 335 memcmp(old->stateid.other, new->stateid.other, sizeof(new->stateid.other)))
336 overwrite = true; 336 overwrite = true;
337 else { 337 else {
@@ -360,7 +360,7 @@ pnfs_layout_from_open_stateid(struct pnfs_layout_hdr *lo,
360 memcpy(lo->stateid.data, state->stateid.data, 360 memcpy(lo->stateid.data, state->stateid.data,
361 sizeof(state->stateid.data)); 361 sizeof(state->stateid.data));
362 } while (read_seqretry(&state->seqlock, seq)); 362 } while (read_seqretry(&state->seqlock, seq));
363 set_bit(NFS_LAYOUT_STATEID_SET, &lo->state); 363 set_bit(NFS_LAYOUT_STATEID_SET, &lo->plh_flags);
364 write_sequnlock(&lo->seqlock); 364 write_sequnlock(&lo->seqlock);
365 dprintk("<-- %s\n", __func__); 365 dprintk("<-- %s\n", __func__);
366} 366}
@@ -374,7 +374,7 @@ pnfs_get_layout_stateid(nfs4_stateid *dst, struct pnfs_layout_hdr *lo,
374 dprintk("--> %s\n", __func__); 374 dprintk("--> %s\n", __func__);
375 do { 375 do {
376 seq = read_seqbegin(&lo->seqlock); 376 seq = read_seqbegin(&lo->seqlock);
377 if (!test_bit(NFS_LAYOUT_STATEID_SET, &lo->state)) { 377 if (!test_bit(NFS_LAYOUT_STATEID_SET, &lo->plh_flags)) {
378 /* This will trigger retry of the read */ 378 /* This will trigger retry of the read */
379 pnfs_layout_from_open_stateid(lo, open_state); 379 pnfs_layout_from_open_stateid(lo, open_state);
380 } else 380 } else
@@ -424,7 +424,7 @@ send_layoutget(struct pnfs_layout_hdr *lo,
424 nfs4_proc_layoutget(lgp); 424 nfs4_proc_layoutget(lgp);
425 if (!lseg) { 425 if (!lseg) {
426 /* remember that LAYOUTGET failed and suspend trying */ 426 /* remember that LAYOUTGET failed and suspend trying */
427 set_bit(lo_fail_bit(iomode), &lo->state); 427 set_bit(lo_fail_bit(iomode), &lo->plh_flags);
428 } 428 }
429 return lseg; 429 return lseg;
430} 430}
@@ -459,26 +459,26 @@ pnfs_insert_layout(struct pnfs_layout_hdr *lo,
459 list_add_tail(&lo->layouts, &clp->cl_layouts); 459 list_add_tail(&lo->layouts, &clp->cl_layouts);
460 spin_unlock(&clp->cl_lock); 460 spin_unlock(&clp->cl_lock);
461 } 461 }
462 list_for_each_entry(lp, &lo->segs, fi_list) { 462 list_for_each_entry(lp, &lo->segs, pls_list) {
463 if (cmp_layout(lp->range.iomode, lseg->range.iomode) > 0) 463 if (cmp_layout(lp->pls_range.iomode, lseg->pls_range.iomode) > 0)
464 continue; 464 continue;
465 list_add_tail(&lseg->fi_list, &lp->fi_list); 465 list_add_tail(&lseg->pls_list, &lp->pls_list);
466 dprintk("%s: inserted lseg %p " 466 dprintk("%s: inserted lseg %p "
467 "iomode %d offset %llu length %llu before " 467 "iomode %d offset %llu length %llu before "
468 "lp %p iomode %d offset %llu length %llu\n", 468 "lp %p iomode %d offset %llu length %llu\n",
469 __func__, lseg, lseg->range.iomode, 469 __func__, lseg, lseg->pls_range.iomode,
470 lseg->range.offset, lseg->range.length, 470 lseg->pls_range.offset, lseg->pls_range.length,
471 lp, lp->range.iomode, lp->range.offset, 471 lp, lp->pls_range.iomode, lp->pls_range.offset,
472 lp->range.length); 472 lp->pls_range.length);
473 found = 1; 473 found = 1;
474 break; 474 break;
475 } 475 }
476 if (!found) { 476 if (!found) {
477 list_add_tail(&lseg->fi_list, &lo->segs); 477 list_add_tail(&lseg->pls_list, &lo->segs);
478 dprintk("%s: inserted lseg %p " 478 dprintk("%s: inserted lseg %p "
479 "iomode %d offset %llu length %llu at tail\n", 479 "iomode %d offset %llu length %llu at tail\n",
480 __func__, lseg, lseg->range.iomode, 480 __func__, lseg, lseg->pls_range.iomode,
481 lseg->range.offset, lseg->range.length); 481 lseg->pls_range.offset, lseg->pls_range.length);
482 } 482 }
483 get_layout_hdr_locked(lo); 483 get_layout_hdr_locked(lo);
484 484
@@ -538,7 +538,7 @@ pnfs_find_alloc_layout(struct inode *ino)
538static int 538static int
539is_matching_lseg(struct pnfs_layout_segment *lseg, u32 iomode) 539is_matching_lseg(struct pnfs_layout_segment *lseg, u32 iomode)
540{ 540{
541 return (iomode != IOMODE_RW || lseg->range.iomode == IOMODE_RW); 541 return (iomode != IOMODE_RW || lseg->pls_range.iomode == IOMODE_RW);
542} 542}
543 543
544/* 544/*
@@ -552,17 +552,17 @@ pnfs_has_layout(struct pnfs_layout_hdr *lo, u32 iomode)
552 dprintk("%s:Begin\n", __func__); 552 dprintk("%s:Begin\n", __func__);
553 553
554 assert_spin_locked(&lo->inode->i_lock); 554 assert_spin_locked(&lo->inode->i_lock);
555 list_for_each_entry(lseg, &lo->segs, fi_list) { 555 list_for_each_entry(lseg, &lo->segs, pls_list) {
556 if (is_matching_lseg(lseg, iomode)) { 556 if (is_matching_lseg(lseg, iomode)) {
557 ret = lseg; 557 ret = lseg;
558 break; 558 break;
559 } 559 }
560 if (cmp_layout(iomode, lseg->range.iomode) > 0) 560 if (cmp_layout(iomode, lseg->pls_range.iomode) > 0)
561 break; 561 break;
562 } 562 }
563 563
564 dprintk("%s:Return lseg %p ref %d\n", 564 dprintk("%s:Return lseg %p ref %d\n",
565 __func__, ret, ret ? atomic_read(&ret->kref.refcount) : 0); 565 __func__, ret, ret ? atomic_read(&ret->pls_refcount.refcount) : 0);
566 return ret; 566 return ret;
567} 567}
568 568
@@ -597,7 +597,7 @@ pnfs_update_layout(struct inode *ino,
597 } 597 }
598 598
599 /* if LAYOUTGET already failed once we don't try again */ 599 /* if LAYOUTGET already failed once we don't try again */
600 if (test_bit(lo_fail_bit(iomode), &nfsi->layout->state)) 600 if (test_bit(lo_fail_bit(iomode), &nfsi->layout->plh_flags))
601 goto out_unlock; 601 goto out_unlock;
602 602
603 get_layout_hdr_locked(lo); /* Matched in nfs4_layoutget_release */ 603 get_layout_hdr_locked(lo); /* Matched in nfs4_layoutget_release */
@@ -606,7 +606,7 @@ pnfs_update_layout(struct inode *ino,
606 lseg = send_layoutget(lo, ctx, iomode); 606 lseg = send_layoutget(lo, ctx, iomode);
607out: 607out:
608 dprintk("%s end, state 0x%lx lseg %p\n", __func__, 608 dprintk("%s end, state 0x%lx lseg %p\n", __func__,
609 nfsi->layout->state, lseg); 609 nfsi->layout->plh_flags, lseg);
610 return lseg; 610 return lseg;
611out_unlock: 611out_unlock:
612 spin_unlock(&ino->i_lock); 612 spin_unlock(&ino->i_lock);
@@ -636,7 +636,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
636 636
637 spin_lock(&ino->i_lock); 637 spin_lock(&ino->i_lock);
638 init_lseg(lo, lseg); 638 init_lseg(lo, lseg);
639 lseg->range = res->range; 639 lseg->pls_range = res->range;
640 *lgp->lsegpp = lseg; 640 *lgp->lsegpp = lseg;
641 pnfs_insert_layout(lo, lseg); 641 pnfs_insert_layout(lo, lseg);
642 642
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index e12367d50489..6fcc07353004 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -31,10 +31,10 @@
31#define FS_NFS_PNFS_H 31#define FS_NFS_PNFS_H
32 32
33struct pnfs_layout_segment { 33struct pnfs_layout_segment {
34 struct list_head fi_list; 34 struct list_head pls_list;
35 struct pnfs_layout_range range; 35 struct pnfs_layout_range pls_range;
36 struct kref kref; 36 struct kref pls_refcount;
37 struct pnfs_layout_hdr *layout; 37 struct pnfs_layout_hdr *pls_layout;
38}; 38};
39 39
40#ifdef CONFIG_NFS_V4_1 40#ifdef CONFIG_NFS_V4_1
@@ -65,7 +65,7 @@ struct pnfs_layout_hdr {
65 struct list_head segs; /* layout segments list */ 65 struct list_head segs; /* layout segments list */
66 seqlock_t seqlock; /* Protects the stateid */ 66 seqlock_t seqlock; /* Protects the stateid */
67 nfs4_stateid stateid; 67 nfs4_stateid stateid;
68 unsigned long state; 68 unsigned long plh_flags;
69 struct inode *inode; 69 struct inode *inode;
70}; 70};
71 71