From 520fc5f30506aadf0670315f45ff35903aadad56 Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Wed, 26 Jan 2011 18:20:39 +0000 Subject: [PATCH] *Speed up mount hack on dirty partitions. Only clear first 64kb of log. (thanks rodries) --- source/logfile.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/logfile.c b/source/logfile.c index 277ad14..0f8bce9 100644 --- a/source/logfile.c +++ b/source/logfile.c @@ -703,7 +703,7 @@ int ntfs_empty_logfile(ntfs_attr *na) char buf[NTFS_BUF_SIZE]; ntfs_log_trace("Entering.\n"); - + if (NVolLogFileEmpty(na->ni->vol)) return 0; @@ -717,7 +717,7 @@ int ntfs_empty_logfile(ntfs_attr *na) pos = 0; while ((count = na->data_size - pos) > 0) { - + if (count > NTFS_BUF_SIZE) count = NTFS_BUF_SIZE; @@ -729,9 +729,10 @@ int ntfs_empty_logfile(ntfs_attr *na) return -1; } pos += count; + if(pos>=64*1024) break; //only clear first 64kb } NVolSetLogFileEmpty(na->ni->vol); - + return 0; }