[XFS] move freeing the mount structure from xfs_mount_free into the callers
authorChristoph Hellwig <hch@infradead.org>
Wed, 29 Aug 2007 01:53:22 +0000 (11:53 +1000)
committerTim Shimmin <tes@chook.melbourne.sgi.com>
Tue, 16 Oct 2007 01:40:52 +0000 (11:40 +1000)
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.

SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29501a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/linux-2.6/xfs_vfs.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_vfsops.c

index c5ec272cdf220030e452eacdbd5204052d544ad6..6ed7f137a031b46ff67908da4ff821476927350e 100644 (file)
@@ -312,6 +312,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
index 71f25947251d81479fe984f041522624e9940732..3e948f58ab823b48d51e54ca947a3d0f175a0652 100644 (file)
@@ -194,7 +194,6 @@ xfs_mount_free(
        }
 
        xfs_icsb_destroy_counters(mp);
-       kmem_free(mp, sizeof(xfs_mount_t));
 }
 
 /*
index 3fe64a3a77a91d69685e0a3c4f9343aeb758f48a..8c0e02279249afc9e2482d341a276bb26ac4c177 100644 (file)
@@ -640,6 +640,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);