Eric Biggers [Tue, 5 Feb 2013 18:44:28 +0000 (12:44 -0600)]
NTFS capture: Get DOS names from ntfs_readdir()
Instead of calling ntfs_get_ntfs_dos_name(), the behavior of which was changed
in NTFS-3g v2013.1.13 and no longer works for files with multiple hard links,
one of which is associated with a hard name, just remember the DOS names when
they're returned from the ntfs_readdir() callback. This works by building a
temporary map from NTFS inode numbers to DOS names each time a directory is
captured.
Eric Biggers [Tue, 1 Jan 2013 06:42:01 +0000 (00:42 -0600)]
rebuild_wim(): Fix use of freed memory
update_lte_of_staging_file() can result in the freeing of the lookup table
entry, so the staging list should be traversed with list_for_each_entry_safe()
rather than list_for_each_entry().
Eric Biggers [Mon, 31 Dec 2012 20:07:11 +0000 (14:07 -0600)]
Various code cleanups
* Improve comments
* Prefix all inode fields with i_
* Rename dentry->inode_dentry_list to d_alias
* Rename inode->dentry_list to i_dentry
* Rename 'struct inode' to 'struct wim_inode'
* Rename 'struct dentry' to 'struct wim_dentry'
* Rename 'struct lookup_table_entry' to 'struct wim_lookup_table_entry'
* Rename 'struct lookup_table' to 'struct wim_lookup_table'
* Rename 'struct wimlib_fd' to 'struct wimfs_fd'
* Remove seemingly unneeded hack from get_symlink_name()
* Fix wrong pointer free in get_names()
* Fix memory leaks in error cases of wimfs_rename()
* Remove unneeded open_flags parameter to create_staging_file()
* Specify O_EXCL instead of O_TRUNC in create_staging_file()
* Don't check SHA1 message digest when extracting only part of a stream (this
bug previously caused truncate() with length > 0 but less than the stream
length to fail).
* Fix format string in lzx_decompress()
* In mounted WIM, return -ENOTDIR when component of path prefix is not a
directory (rather than -ENOENT as was the case in most places).
Eric Biggers [Fri, 21 Dec 2012 03:59:27 +0000 (21:59 -0600)]
LZX decompression cleanups
- Improve comments
- Get rid of bitstream_read_bytes() because it wasn't clear what it was supposed
to do. Just inline what needs to be done in the appropriate places.
- Only undo the call instruction preprocessing if 0xe8 bytes may be in the input
data.
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.