aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-01-11 06:47:43 -0500
committerAlex Elder <aelder@sgi.com>2010-01-15 16:33:39 -0500
commit44b56e0a1aed522a10051645e85d300e10926fd3 (patch)
treec46879f4feaec1b19456395d74a2e9c27dde530d /fs/xfs/xfs_mount.c
parent4196ac08c023c6dab90c3fa460d9c06deaa304c4 (diff)
xfs: convert remaining direct references to m_perag
Convert the remaining direct lookups of the per ag structures to use get/put accesses. Ensure that the loops across AGs and prior users of the interface balance gets and puts correctly. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index eb403b40e120..9055b60730d0 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -438,18 +438,20 @@ xfs_initialize_perag(
438 } 438 }
439 439
440 /* This ag is preferred for inodes */ 440 /* This ag is preferred for inodes */
441 pag = &mp->m_perag[index]; 441 pag = xfs_perag_get(mp, index);
442 pag->pagi_inodeok = 1; 442 pag->pagi_inodeok = 1;
443 if (index < max_metadata) 443 if (index < max_metadata)
444 pag->pagf_metadata = 1; 444 pag->pagf_metadata = 1;
445 xfs_initialize_perag_icache(pag); 445 xfs_initialize_perag_icache(pag);
446 xfs_perag_put(pag);
446 } 447 }
447 } else { 448 } else {
448 /* Setup default behavior for smaller filesystems */ 449 /* Setup default behavior for smaller filesystems */
449 for (index = 0; index < agcount; index++) { 450 for (index = 0; index < agcount; index++) {
450 pag = &mp->m_perag[index]; 451 pag = xfs_perag_get(mp, index);
451 pag->pagi_inodeok = 1; 452 pag->pagi_inodeok = 1;
452 xfs_initialize_perag_icache(pag); 453 xfs_initialize_perag_icache(pag);
454 xfs_perag_put(pag);
453 } 455 }
454 } 456 }
455 return index; 457 return index;
@@ -731,12 +733,13 @@ xfs_initialize_perag_data(xfs_mount_t *mp, xfs_agnumber_t agcount)
731 error = xfs_ialloc_pagi_init(mp, NULL, index); 733 error = xfs_ialloc_pagi_init(mp, NULL, index);
732 if (error) 734 if (error)
733 return error; 735 return error;
734 pag = &mp->m_perag[index]; 736 pag = xfs_perag_get(mp, index);
735 ifree += pag->pagi_freecount; 737 ifree += pag->pagi_freecount;
736 ialloc += pag->pagi_count; 738 ialloc += pag->pagi_count;
737 bfree += pag->pagf_freeblks; 739 bfree += pag->pagf_freeblks;
738 bfreelst += pag->pagf_flcount; 740 bfreelst += pag->pagf_flcount;
739 btree += pag->pagf_btreeblks; 741 btree += pag->pagf_btreeblks;
742 xfs_perag_put(pag);
740 } 743 }
741 /* 744 /*
742 * Overwrite incore superblock counters with just-read data 745 * Overwrite incore superblock counters with just-read data