File speed-umount.patch of Package util-linux
--- util-linux-ng-2.14.1/mount/umount.c
+++ util-linux-ng-2.14.1/mount/umount.c
@@ -382,6 +382,7 @@
umount_all (char *types, char *test_opts) {
struct mntentchn *mc, *hd;
int errors = 0;
+ int umount_count = 0;
hd = mtab_head();
if (!hd->prev)
@@ -391,10 +392,11 @@
&& matching_opts (mc->m.mnt_opts, test_opts)) {
errors |= umount_one (mc->m.mnt_fsname, mc->m.mnt_dir,
mc->m.mnt_type, mc->m.mnt_opts, mc);
+ umount_count++;
}
}
-
- sync ();
+ if (umount_count > 0)
+ sync ();
return errors;
}