Eric Biggers [Wed, 19 Dec 2012 18:46:08 +0000 (12:46 -0600)]
write_ntfs_data_streams(): Reserve space for streams
Call ntfs_attr_truncate_solid() with the size of each stream before extracting
it as a NTFS attribute. This should allocate the space (extents, etc.) needed
for the data before actually extracting it.
Eric Biggers [Wed, 19 Dec 2012 05:08:20 +0000 (23:08 -0600)]
Ugly hack
After exporting an image, an inode list may be shared between multiple images.
This is a fix to make deleting the inodes from the list still work when the list
head may have been freed already.
Eric Biggers [Wed, 19 Dec 2012 02:09:59 +0000 (20:09 -0600)]
utf8_to_utf16(), utf16_to_utf8() changes
These two functions have been moved out of 'util.c' to a separate file
'encoding.c'. They also now return an integer error code because they can fail
for at least two reasons (no memory, and invalid UTF-8 or UTF-16LE character).
Eric Biggers [Tue, 18 Dec 2012 05:56:41 +0000 (23:56 -0600)]
mount_image.c: More message queue changes
Yet another rewrite of the message sending/receiving functions. Everything is
now sent through a generic message loop function with callbacks. At the same
time, another message has been introduced that is sent from the daemon to the
unmount process to provide its pid. Then, the unmount process can detect if the
filesystem daemon has crashed by polling this pid every second. (This should
solve the 10 minute timeout problem.)
Eric Biggers [Tue, 18 Dec 2012 00:22:00 +0000 (18:22 -0600)]
Allow in-place overwrites when unmounting read-write mounted WIM
- Add WIMLIB_UNMOUNT_FLAG_REBUILD and WIMLIB_UNMOUNT_FLAG_RECOMPRESS
- Make lock_wim() set a flag WIMStruct.wim_locked to prevent double-locks
- Maintain the inode list for each image through a read-write mount (not
strictly necessary yet, but makes sense to keep it correct)
- overwrite_wim_inplace(): Search for new streams by searching directly through
the lookup table for entries that are not located in the WIM being
overwritten.
The ad-hoc format of the unmount messages has been expanded with a header that
specifies the message size and the minimum and current version of the library
sending the message. This could potentially make things go smoother if the
messages are changed and unmounts are done with a different library version than
the mount is with.
Also, some code was refactored to reduce function length.
Eric Biggers [Sun, 16 Dec 2012 02:50:30 +0000 (20:50 -0600)]
Various cleanups
- wim_timestamp_to_str() instead of asctime(gmtime(wim_timestamp_to_unix()))
- inode_stream_lte() non-inline to save space
- new errors WIMLIB_ERR_CHAR_CONVERSION and WIMLIB_ERR_INVALID_PART_NUMBER
- write_xml_data(): Have libxml2 write directly to output file with UTF-16LE
encoding (no need for in-memory buffer and converting to UTF-16LE afterwards)
- read_header(): Validate total_parts and part_number
- Fix a couple potential integer overflows
- Fix some indentation and phase out more 'uint' uses
- Remove some unneeded DEBUG() statements
Eric Biggers [Sat, 15 Dec 2012 06:36:24 +0000 (00:36 -0600)]
XPRESS compressor: increase max match
XPRESS_MAX_MATCH was previously incorrectly set to 255, even though it can
really be up to 65538. This was fixed and the code for handling this was fixed,
so the XPRESS compressor can now output longer matches. (The decompressor could
already handle these longer matches.)
Eric Biggers [Sat, 24 Nov 2012 05:37:14 +0000 (23:37 -0600)]
main_writer_thread_proc(): Fix minor issues
- If a resource compresses to the same size or larger than the original size,
directly write it uncompressed with the main thread.
- Re-organize the code so as to not force the first resource to be compressed if
it doesn't need to be.