aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
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