mirror of
https://github.com/Maschell/libntfs-wiiu.git
synced 2024-12-18 08:01:50 +01:00
*Speed up mount hack on dirty partitions. Only clear first 64kb of log. (thanks rodries)
This commit is contained in:
parent
ee41c26551
commit
520fc5f305
@ -703,7 +703,7 @@ int ntfs_empty_logfile(ntfs_attr *na)
|
|||||||
char buf[NTFS_BUF_SIZE];
|
char buf[NTFS_BUF_SIZE];
|
||||||
|
|
||||||
ntfs_log_trace("Entering.\n");
|
ntfs_log_trace("Entering.\n");
|
||||||
|
|
||||||
if (NVolLogFileEmpty(na->ni->vol))
|
if (NVolLogFileEmpty(na->ni->vol))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -717,7 +717,7 @@ int ntfs_empty_logfile(ntfs_attr *na)
|
|||||||
|
|
||||||
pos = 0;
|
pos = 0;
|
||||||
while ((count = na->data_size - pos) > 0) {
|
while ((count = na->data_size - pos) > 0) {
|
||||||
|
|
||||||
if (count > NTFS_BUF_SIZE)
|
if (count > NTFS_BUF_SIZE)
|
||||||
count = NTFS_BUF_SIZE;
|
count = NTFS_BUF_SIZE;
|
||||||
|
|
||||||
@ -729,9 +729,10 @@ int ntfs_empty_logfile(ntfs_attr *na)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
pos += count;
|
pos += count;
|
||||||
|
if(pos>=64*1024) break; //only clear first 64kb
|
||||||
}
|
}
|
||||||
|
|
||||||
NVolSetLogFileEmpty(na->ni->vol);
|
NVolSetLogFileEmpty(na->ni->vol);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user