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.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index f4daf1ec9931..71f25947251d 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -160,11 +160,6 @@ xfs_mount_free(
160 xfs_mount_t *mp, 160 xfs_mount_t *mp,
161 int remove_bhv) 161 int remove_bhv)
162{ 162{
163 if (mp->m_ihash)
164 xfs_ihash_free(mp);
165 if (mp->m_chash)
166 xfs_chash_free(mp);
167
168 if (mp->m_perag) { 163 if (mp->m_perag) {
169 int agno; 164 int agno;
170 165
@@ -342,6 +337,17 @@ xfs_mount_validate_sb(
342 return 0; 337 return 0;
343} 338}
344 339
340STATIC void
341xfs_initialize_perag_icache(
342 xfs_perag_t *pag)
343{
344 if (!pag->pag_ici_init) {
345 rwlock_init(&pag->pag_ici_lock);
346 INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
347 pag->pag_ici_init = 1;
348 }
349}
350
345xfs_agnumber_t 351xfs_agnumber_t
346xfs_initialize_perag( 352xfs_initialize_perag(
347 bhv_vfs_t *vfs, 353 bhv_vfs_t *vfs,
@@ -396,12 +402,14 @@ xfs_initialize_perag(
396 pag->pagi_inodeok = 1; 402 pag->pagi_inodeok = 1;
397 if (index < max_metadata) 403 if (index < max_metadata)
398 pag->pagf_metadata = 1; 404 pag->pagf_metadata = 1;
405 xfs_initialize_perag_icache(pag);
399 } 406 }
400 } else { 407 } else {
401 /* Setup default behavior for smaller filesystems */ 408 /* Setup default behavior for smaller filesystems */
402 for (index = 0; index < agcount; index++) { 409 for (index = 0; index < agcount; index++) {
403 pag = &mp->m_perag[index]; 410 pag = &mp->m_perag[index];
404 pag->pagi_inodeok = 1; 411 pag->pagi_inodeok = 1;
412 xfs_initialize_perag_icache(pag);
405 } 413 }
406 } 414 }
407 return index; 415 return index;
@@ -1033,13 +1041,6 @@ xfs_mountfs(
1033 xfs_trans_init(mp); 1041 xfs_trans_init(mp);
1034 1042
1035 /* 1043 /*
1036 * Allocate and initialize the inode hash table for this
1037 * file system.
1038 */
1039 xfs_ihash_init(mp);
1040 xfs_chash_init(mp);
1041
1042 /*
1043 * Allocate and initialize the per-ag data. 1044 * Allocate and initialize the per-ag data.
1044 */ 1045 */
1045 init_rwsem(&mp->m_peraglock); 1046 init_rwsem(&mp->m_peraglock);
@@ -1190,8 +1191,6 @@ xfs_mountfs(
1190 error3: 1191 error3:
1191 xfs_log_unmount_dealloc(mp); 1192 xfs_log_unmount_dealloc(mp);
1192 error2: 1193 error2:
1193 xfs_ihash_free(mp);
1194 xfs_chash_free(mp);
1195 for (agno = 0; agno < sbp->sb_agcount; agno++) 1194 for (agno = 0; agno < sbp->sb_agcount; agno++)
1196 if (mp->m_perag[agno].pagb_list) 1195 if (mp->m_perag[agno].pagb_list)
1197 kmem_free(mp->m_perag[agno].pagb_list, 1196 kmem_free(mp->m_perag[agno].pagb_list,