History log of /haiku/src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingAttributeCookie.cpp
Revision Date Author Comments
# d1a0bc4f 01-Apr-2019 Augustin Cavalier <waddlesplash@gmail.com>

packagefs: Remove support for HPKGv1.

The current version is "v2", and it has been since the final PM branch
was merged back in 2013, so it's unclear if anyone actually uses this
file format. The "package" command can still of course read these
files, it's just that packagefs will now not be able to.

It's very unlikely anyone is impacted by this change.


# b23d5047 31-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: UnpackingAttributeCookie: Open package

... when reading non-inline attribute data. Generally the package should
already have been opened by the PackageNode owning the attribute (in
InitVFS()), but that isn't the case for queries, which can read
attributes from entirely unsuspecting nodes.

Together with the QueryParser fix that should fix queries involving
non-indexed attributes.


# 69a1f1f5 20-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Fix attribute indexing

Since the package nodes' attributes are indexed before the VFS has
accessed any of its nodes, the package wasn't open and reading the
attribute data would fail. We do now open the package explicitly in
UnpackingAttributeCookie::IndexAttribute(). Moreover, as an
optimization, we also open the package in Volume::_AddPackageContent(),
so the package file isn't repeatedly opened and closed as its nodes are
being registered.


# 1f633814 17-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

hpkg format: compress the whole heap

Instead of handling compression for individual file/attribute data we
do now compress the whole heap where they are stored. This
significantly improves compression ratios. We still divide the
uncompressed data into 64 KiB chunks and use a chunk offset array for
the compressed chunks to allow for quick random access without too much
overhead. The tradeoff is a limited possible compression ratio -- i.e.
we won't be as good as tar.gz (though surprisingly with my test
archives we did better than zip).

The other package file sections (package attributes and TOC) are no
longer compressed individually. Their uncompressed data are simply
pushed onto the heap where the usual compression strategy applies. To
simplify things the repository format has been changed in the same
manner although it doesn't otherwise use the heap, since it only stores
meta data.

Due to the data compression having been exposed in public and private
API, this change touches a lot of package kit using code, including
packagefs and the boot loader packagefs support. The latter two haven't
been tested yet. Moreover packagefs needs a new kind of cache so we
avoid re-reading the same heap chunk for two different data items it
contains.


# 11cecf98 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Add support for hpkg format V1

* Add union-like class PackageData which wraps the V1 and V2
BPackageData classes.
* GlobalFactory: Create a data reader depending on the data format
version.
* Package: Add a loader for V1 format and try that, if the other one
fails.


# 2c32402d 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: internalize BPackageDataReader

It is no longer public (or even private) API. BPackageDataReaderFactory
returns a BAbstractBufferedDataReader instead. The advantage is that
the latter doesn't have hpkg format specific dependencies.


# d07c930c 11-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Share string instances globally

Introduce a class String which refers to shared private data that is
registered in a global hash table (in class StringPool) and use the
class consequently. This eliminates duplicate allocations for the same
string and also speeds up tests for equality. There's quite a bit
overhead for the management structures (apparently even more than for
the string data itself), but due to almost all strings being used
multiple times this still almost halves the memory usage for string
data.


# 1e7416d9 11-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Organize sources into subdirectories


# b23d504796788536d66b523a2b5a3359691b3b2b 31-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: UnpackingAttributeCookie: Open package

... when reading non-inline attribute data. Generally the package should
already have been opened by the PackageNode owning the attribute (in
InitVFS()), but that isn't the case for queries, which can read
attributes from entirely unsuspecting nodes.

Together with the QueryParser fix that should fix queries involving
non-indexed attributes.


# 69a1f1f53f7167363b17eeba6141b92bd8dfd4d3 20-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Fix attribute indexing

Since the package nodes' attributes are indexed before the VFS has
accessed any of its nodes, the package wasn't open and reading the
attribute data would fail. We do now open the package explicitly in
UnpackingAttributeCookie::IndexAttribute(). Moreover, as an
optimization, we also open the package in Volume::_AddPackageContent(),
so the package file isn't repeatedly opened and closed as its nodes are
being registered.


# 1f633814fa347b0bd822f683af731615df600347 17-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

hpkg format: compress the whole heap

Instead of handling compression for individual file/attribute data we
do now compress the whole heap where they are stored. This
significantly improves compression ratios. We still divide the
uncompressed data into 64 KiB chunks and use a chunk offset array for
the compressed chunks to allow for quick random access without too much
overhead. The tradeoff is a limited possible compression ratio -- i.e.
we won't be as good as tar.gz (though surprisingly with my test
archives we did better than zip).

The other package file sections (package attributes and TOC) are no
longer compressed individually. Their uncompressed data are simply
pushed onto the heap where the usual compression strategy applies. To
simplify things the repository format has been changed in the same
manner although it doesn't otherwise use the heap, since it only stores
meta data.

Due to the data compression having been exposed in public and private
API, this change touches a lot of package kit using code, including
packagefs and the boot loader packagefs support. The latter two haven't
been tested yet. Moreover packagefs needs a new kind of cache so we
avoid re-reading the same heap chunk for two different data items it
contains.


# 11cecf980b5ee6a21563a7e78d4f2238a8b4d90f 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Add support for hpkg format V1

* Add union-like class PackageData which wraps the V1 and V2
BPackageData classes.
* GlobalFactory: Create a data reader depending on the data format
version.
* Package: Add a loader for V1 format and try that, if the other one
fails.


# 2c32402da583cbd0a091a08308237592679c05c4 12-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

package kit: internalize BPackageDataReader

It is no longer public (or even private) API. BPackageDataReaderFactory
returns a BAbstractBufferedDataReader instead. The advantage is that
the latter doesn't have hpkg format specific dependencies.


# d07c930c1eb710289922edd3abf5244c259a86c6 11-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Share string instances globally

Introduce a class String which refers to shared private data that is
registered in a global hash table (in class StringPool) and use the
class consequently. This eliminates duplicate allocations for the same
string and also speeds up tests for equality. There's quite a bit
overhead for the management structures (apparently even more than for
the string data itself), but due to almost all strings being used
multiple times this still almost halves the memory usage for string
data.


# 1e7416d9b3846396e2f7d6552e37d72664cd6853 11-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

packagefs: Organize sources into subdirectories