[Top] [All Lists]

[PATCH 4/8] xfsprogs: mkfs.xfs: let libxfs_umount() do its thing

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/8] xfsprogs: mkfs.xfs: let libxfs_umount() do its thing
From: Alex Elder <aelder@xxxxxxx>
Date: Thu, 10 Nov 2011 14:35:14 -0600
Cc: Kevan Rehm <kfr@xxxxxxx>, Alex Elder <aelder@xxxxxxx>
In-reply-to: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
In-reply-to: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
References: <1320957318-16269-1-git-send-email-aelder@xxxxxxx>
References: <3ed89446f6dc1231ec1de712f242522052952b7e.1320955675.git.aelder@xxxxxxx>
From: Kevan Rehm <kfr@xxxxxxx>

In the mkfs.xfs main() routine (which is gargantuan, by the way),
there are a few function calls intended to do some clean up before
unmounting the filesystem.

The first function drops references that will be dropped again in
the unmnount call.  The others assume all references will go away as
a result of the purge, but the filesystem's root inode reference
will remain.

Let the unmount function take care of destroying the real-time
structures.  And instead of purging the inode and block caches, just
flush them (at least the block cache) and let the unmount code take
care of the final purge.

Signed-off-by: Alex Elder <aelder@xxxxxxx>
 mkfs/xfs_mkfs.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index f527f3d..213cc74 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2674,9 +2674,7 @@ an AG size that is one stripe unit smaller, for example 
         * Dump all inodes and buffers before marking us all done.
         * Need to drop references to inodes we still hold, first.
-       libxfs_rtmount_destroy(mp);
-       libxfs_icache_purge();
-       libxfs_bcache_purge();
+       libxfs_bcache_flush();
         * Mark the filesystem ok.

<Prev in Thread] Current Thread [Next in Thread>