Skip to contentSkip to conversation

move freeing the mount structure from xfs_mount_free into the callers

PATCH In review Christoph Hellwig 1 participant 1 message Aug 23, 2007 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 9/17 move freeing the mount structure from xfs_mount_free into the callers

In the next patch we need to look at the mount structure until just before it's freed, so we need to be able to free it as the very last thing in xfs_unmount.

fs/xfs/xfs_mount.c +0 -1
Index: linux-2.6-xfs/fs/xfs/xfs_mount.c
===================================================================
@@ -194,7 +194,6 @@ xfs_mount_free(
 	}
 
 	xfs_icsb_destroy_counters(mp);
-	kmem_free(mp, sizeof(xfs_mount_t));
 }
 
 /*
fs/xfs/xfs_vfsops.c +1 -0
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c
===================================================================
@@ -639,6 +639,7 @@ out:
 		 * and free the super block buffer & mount structures.
 		 */
 		xfs_unmountfs(mp, credp);
+		kmem_free(mp, sizeof(xfs_mount_t));
 	}
 
 	return XFS_ERROR(error);
fs/xfs/linux-2.6/xfs_vfs.c +1 -0
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vfs.c
===================================================================
@@ -411,6 +411,7 @@ bhv_remove_all_vfsops(
 	mp = XFS_VFSTOM(vfsp);
 	VFS_REMOVEBHV(vfsp, &mp->m_bhv);
 	xfs_mount_free(mp, 0);
+	kmem_free(mp, sizeof(xfs_mount_t));
 }
 
 void