aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-08-13 02:50:47 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-08-13 02:50:47 -0400
commitff4f038c6bbb27044a84adbcd27bc237d7237e66 (patch)
treec6358574b56ae08505d1f914f97a6c772addae4d /fs/xfs
parent6203300e5e9121440b27d3ed0b9fe2a64cb62b53 (diff)
[XFS] refactor xfs_mount_free
xfs_mount_free mostly frees the perag data, which is something that is duplicated in the mount error path. Move the XFS_QM_DONE call to the caller and remove the useless mutex_destroy/spinlock_destroy calls so that we can re-use it for the mount error path. Also rename it to xfs_free_perag to reflect what it does. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31836a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_mount.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 4d4161598406..081fb6a02ac3 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -128,7 +128,7 @@ static const struct {
128 * initialized. 128 * initialized.
129 */ 129 */
130STATIC void 130STATIC void
131xfs_mount_free( 131xfs_free_perag(
132 xfs_mount_t *mp) 132 xfs_mount_t *mp)
133{ 133{
134 if (mp->m_perag) { 134 if (mp->m_perag) {
@@ -139,13 +139,6 @@ xfs_mount_free(
139 kmem_free(mp->m_perag[agno].pagb_list); 139 kmem_free(mp->m_perag[agno].pagb_list);
140 kmem_free(mp->m_perag); 140 kmem_free(mp->m_perag);
141 } 141 }
142
143 spinlock_destroy(&mp->m_ail_lock);
144 spinlock_destroy(&mp->m_sb_lock);
145 mutex_destroy(&mp->m_ilock);
146 mutex_destroy(&mp->m_growlock);
147 if (mp->m_quotainfo)
148 XFS_QM_DONE(mp);
149} 142}
150 143
151/* 144/*
@@ -922,7 +915,6 @@ xfs_mountfs(
922 __uint64_t resblks; 915 __uint64_t resblks;
923 __int64_t update_flags = 0LL; 916 __int64_t update_flags = 0LL;
924 uint quotamount, quotaflags; 917 uint quotamount, quotaflags;
925 int agno;
926 int uuid_mounted = 0; 918 int uuid_mounted = 0;
927 int error = 0; 919 int error = 0;
928 920
@@ -1216,12 +1208,7 @@ xfs_mountfs(
1216 error3: 1208 error3:
1217 xfs_log_unmount_dealloc(mp); 1209 xfs_log_unmount_dealloc(mp);
1218 error2: 1210 error2:
1219 for (agno = 0; agno < sbp->sb_agcount; agno++) 1211 xfs_free_perag(mp);
1220 if (mp->m_perag[agno].pagb_list)
1221 kmem_free(mp->m_perag[agno].pagb_list);
1222 kmem_free(mp->m_perag);
1223 mp->m_perag = NULL;
1224 /* FALLTHROUGH */
1225 error1: 1212 error1:
1226 if (uuid_mounted) 1213 if (uuid_mounted)
1227 uuid_table_remove(&mp->m_sb.sb_uuid); 1214 uuid_table_remove(&mp->m_sb.sb_uuid);
@@ -1307,7 +1294,9 @@ xfs_unmountfs(
1307#if defined(DEBUG) 1294#if defined(DEBUG)
1308 xfs_errortag_clearall(mp, 0); 1295 xfs_errortag_clearall(mp, 0);
1309#endif 1296#endif
1310 xfs_mount_free(mp); 1297 xfs_free_perag(mp);
1298 if (mp->m_quotainfo)
1299 XFS_QM_DONE(mp);
1311} 1300}
1312 1301
1313STATIC void 1302STATIC void