Age | Commit message (Collapse) | Author |
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Remove the asserts. If we eat more data than present, reset the
offset and count to zero.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
There is no need to keep a copy of the state data internally. If the
external user wants to reset/rewind, they can simply keep a copy of
the old state, now that it is completely transparent.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of holding the state internally, move it outside and let the
user pass it in. This allows processing multiple directories and going
back and forth between them, while also simplifying the dir reader
internals.
The sqfs_dir_reader_get_inode function can also be made more generic
to accept a reference instead of being fully state dependent.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Those functions are only used in the example code, we remove them for
now to make restructuring easier and fix the examples later.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The only user in the code base is sqfs_dir_reader_find_by_path.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The reason this is implemented separately, instead of roling it into
the recursive iterator, is so that we can do additional filtering
in between. For instance, we can rewrite the path and the hard link
path will match up, or if we remove nodes from the hierarchy, we
won't end up with a hard link pointing outside.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Rename the open function to sqfs_file_open, use an argument for the
return pointer and pass back and error number on failure. Also add
an inermediate function to open an sqfs_file_t using a handle, similar
to the stream API. The get_file_size function is moved to the native
wrappers and some of the implementation is cleaned up a little.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This might be needed externally for things like hard link detection.
For the unix implementation, store the actual inode number here.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
To the sqfs_data_reader_t is added, an sqfs_istream_t implementation
that internally reads through the data reader. The uses of the
data_reader_dump function are removed and the function is subsequently
removed from libcommon.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The recursive part and the filter part are split up, the recursive
iterator wrapper is moved into libsquashfs and the libio iterator
is modified to use that internally instead of implementig the
recursion step.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Exact operation performed:
git ls-files -z | \
xargs -0 sed -i -e 's/dir_entry_t/sqfs_dir_entry_t/g
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Exact operation performed:
git ls-files -z | \
xargs -0 sed -i -e 's/sqfs_dir_entry_t/sqfs_dir_node_t/g'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Start with a common prefix "sqfs_native_file_*"
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
It is mainly a very thin wrapper on top of the block processor so far.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
By adding additional close/duplicate primitives, the remaining, mostly
identical istream/ostream/file code is mostly identical between Windows
and Unix and be merged, mostly without stitches.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
On Unix like OSes, this saves/restores errno, on Windows both errno
and GetLastError state are saved/restored.
This should make it simpler to preserve that across function calls.
Additionally, while tracking down uses of GetLastError, some places
where the error code was printed out directly where replaced with
instances of w32_perror.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
- The ostream creation functions already have flag arguments,
but make them an sqfs_u32 instead of int.
- Add flag arguments to the istream functions, sanitzie and forward
them when opening the handle.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Having a function to interpret the flags and open a native file handle
simplifies the istream/ostream/file code which shares that decoding
part, particularly on windows where the character set needs to be
transformed.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Similar to the sqfs_istream_t & sqfs_ostream_t interfaces.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For now, only the interfaces and helper functions are moved, the
concrete implementations remain in libio.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of a separate append-sparse function, simply accept NULL
as an input for append. For both Unix and Win32, a fallback needs
to be implemented. For XFRM, we can just memset the input buffer
to zero, same for the libsquashfs data writer.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The common pattern is used in rdsquashfs and sqfs2tar, move the code
to libsquashfs.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The structure and functions are renamed to sqfs_xattr_* instead,
an additional helper is added to accept an encoded xattr.
Documentation and unit test are added as well.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The idea of the block align feature was to allow micro-managing that
some files are forcefully aligned to 1k/4k ("device block") boundaries,
hoping to improve access time at the cost of data density. The feature
was not exposed in the tools for a long time and eventuall added to the
sort file. Measurement and experimentation showed, that it in fact
worsened the read performance on a test system with an old micro SD
card as the bottle neck.
The feature is removed, and if needed, can be brought back simply by
wrapping/sub-classing the default block writer, if need be..
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|