History log of /haiku-fatelf/src/add-ons/kernel/file_systems/packagefs/Volume.h
Revision Date Author Comments
# 564f56b1 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix node handling on package addition/removal

* UnpackingLeafNode: Add a fFinalPackageNode attribute. It is set when
the node is about to be removed and will point to the node's previous
head package node and be used in its stead. From the perspective of
the FS hooks this leaves the node in an unchanged state.
* Unpacking[Leaf,Directory]Node:
- Add WillBeFirstPackageNode(), returning whether the given package
node would become the head package node when added.
- Add PrepareForRemoval() which removes all package nodes. In case of
UnpackingLeafNode it also sets fFinalPackageNode.
- Add CloneTransferPackageNodes(). It is only implemented for
UnpackingLeafNode. It clones the node, transfers all package nodes
to the clone and sets fFinalPackageNode on this node.
* Volume::_{Add,Remove}PackageNode(): Solved the following TODO: When a
package is added or removed and a file present in both the
added/removed package and another package with the version in the
former having precedence, we have to remove the node (leaving it
unchanged) and replace it by a new node. This prevents clients having
the node opened or mapped from suddenly seeing different data. It also
fixes unbalanced calls to PackageNode::VFSInit()/VFSUninit() which
would result in file descriptors to package files being leaked.


# 4caf2827 15-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix handling of shine-through directories

* Add a new class ShineThroughDirectory for shine-through directories
instead of using UnpackingDirectory.
* Split up setting up the shine-through directories in two steps. First
the directories are only created. That happens before adding the
initial package domains. After publishing the root node we bind the
shine-through directories to the underlying directories.
* This makes adding a package directory with the same name as a
shine-through directory fail in _AddPackageNode() as originally
intended. Since we no longer want it to fail -- the package daemon
will copy the files in the respective directories as part of the
activation process -- we simply skip the directory now. Adjust
_AddPackageNode() and _AddPackageContentRootNode() accordingly.


# 0b45c28c 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Implement packagefs index (dir) hooks


# 182e58f7 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

NodeListener::NodeChanged(): Provide old value

* Add interface OldNodeAttributes an instance of which is passed to
NodeListener::NodeChanged() to provide the old attribute values
(currently only modification time and file size).
* Also extend PackageLinksListener::PackageLinkNodeChanged() with a
OldNodeAttributes parameter.
* Add OldNodeAttributes implementations for PackageLinkSymlink (inner
class OldAttributes) and UnpackingNode (OldUnpackageNodeAttributes).


# 617ac41c 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Query class and query management in Volume


# 4791f5eb 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Index base class and index table in Volume


# ec59ac75 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a global node listener mechanism


# d8ea0a8a 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package link updates/node monitoring

* PackageLinksListener: Rename methods from *Directory*() to *Node*()
and change parameter to Node*. Also add a *Changed() method.
* PackageLinkDirectory: Update only when necessary and what is necessary
(currently only the self link).


# be157836 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume: Remove all package contents on destruction


# fe49869e 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add package link directories to system volume

* Add PackageLinksListener interface. It is used by
PackageLink[s]Directory to notify a listener about changes.
* Volume does now implement PackageLinksListener and recursively adds/
removes package link directories.

This makes the package link directories appear at least. They are still
empty.


# 63875d17 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add yet empty package-links directory

* Add PackageLinksDirectory Directory subclass. Currently not doing
anything.
* PackageFSRoot: Create a PackageLinksDirectory.
* Volume: Add/remove the package links directory for the system volume.


# 20142717 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove package related dependencies from Node

* Move package related methods from Node to new interface UnpackingNode.
* LeafNode and Directory derive from UnpackingNode now.
* Adjust Volume implementation accordingly.


# 1ac0daa9 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Make Volume::Read{Lock,Unlock} const


# 991ba9fd 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

WIP towards packagefs package links support

* Introduce Version class representing a version.
* Introduce Dependency and Resolvable class and add lists of either to
Package.
* Parse package attributes and add dependencies and resolvables to
Package.
* Add a mount type to Volume and add a respective mount parameter
"mount-type" (values "system", "common", "home", "custom"). Also
implies the shine-through type, if that's not given.
* Introduce class PackageFamily which groups equally named and versioned
packages.
* Add class PackageFSRoot. Each instance represents a possible file
system root (separate roots for different chroot environments). Tracks
Volumes belonging to the same root and their packages.


# 6e2af637 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for shine-through directories

* packagefs_mount(): Initialize the fs_volume earlier, so it is more
usuable in Volume::Mount().
* The new mount parameter "shine-through" can be used to specify which
shine-through mode shall be used. Can be "system", "common", "home",
and "none". Depending on the setting it is decided which directories
of the underlying file system are bind-mounted on top of ours.
* Fix infinite loop in Volume::_RemovePackageContent().
* Use the RETURN_ERROR() macro in more places to help with debugging.


# 6f8d1ab0 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implement fetching of initial domain from the mount parameters in
order to be able to mount packages from somewhere else than
'/boot/common/packages' (squashes a TODO)
* squashed another TODO about needing to remove nodes of already
installed packages if anything goes wrong during the activation
of a package domain
* fix what to me looks like a bug in Volume::AddPackageDomainJob::Do(),
fDomain is accessed unconditionally in the destructor, so NULLing
it here is bad (it doesn't make sense from a reference-passing POV
either). The problem never showed as this code is never being executed
currently (no way to add additional package domains as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45bd7bb3 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f59a69a 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc2 build and warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d73033ce 21-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made PackageDomain BReferenceable.
* LeafNode/Directory: We make sure that the added PackageNode with the newest
modified time is always at the head of the list. This is the package node
whose stat, attribute data and, in case of non-directory nodes, also content
data will be returned. This results in a well-defined algorithm what happens
when multiple directories contain the same file -- the newest file wins.
* Resolved most TODOs regarding error handling when adding a package domain,
package, or package node.
* Volume::_AddPackageContentRootNode(): Fixed the back tracking loop. It would
just continue with siblings of the given root node, causing them to be added
more than once, leading to data structure corruption.
* We now listen to the packages directory. When packages are added or removed
their contents is automatically added/removed to the file system. We don't
listen to the package files themselves yet. I.e. modifying an "installed"
package in place respectively copying/downloading it there will probably not
work correctly.
Due to a limitation in the userlandfs the mechanism works correctly only when
using the kernel module. When running the userland version, one better leaves
the packages directory alone while packagefs is mounted.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34172 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc32c484 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Work in progress:
* The FS parses package files from "/boot/common/packages" and builds an
node tree representation of the contained entries. Merging directories should
work. Lots of other stuff is missing yet, though.
* Implemented the hooks for directory entry lookup and iteration. So it's
possible to see the contents of the FS at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34088 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b932032a 15-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the most basic functionality required to cleanly mount and unmount
(at least in userlandfs).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34069 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 564f56b15075b0d15349ebfcc24f07b33ce109a0 20-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix node handling on package addition/removal

* UnpackingLeafNode: Add a fFinalPackageNode attribute. It is set when
the node is about to be removed and will point to the node's previous
head package node and be used in its stead. From the perspective of
the FS hooks this leaves the node in an unchanged state.
* Unpacking[Leaf,Directory]Node:
- Add WillBeFirstPackageNode(), returning whether the given package
node would become the head package node when added.
- Add PrepareForRemoval() which removes all package nodes. In case of
UnpackingLeafNode it also sets fFinalPackageNode.
- Add CloneTransferPackageNodes(). It is only implemented for
UnpackingLeafNode. It clones the node, transfers all package nodes
to the clone and sets fFinalPackageNode on this node.
* Volume::_{Add,Remove}PackageNode(): Solved the following TODO: When a
package is added or removed and a file present in both the
added/removed package and another package with the version in the
former having precedence, we have to remove the node (leaving it
unchanged) and replace it by a new node. This prevents clients having
the node opened or mapped from suddenly seeing different data. It also
fixes unbalanced calls to PackageNode::VFSInit()/VFSUninit() which
would result in file descriptors to package files being leaked.


# 4caf282707b832ce5a9f86bce398ce466066f9f3 15-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix handling of shine-through directories

* Add a new class ShineThroughDirectory for shine-through directories
instead of using UnpackingDirectory.
* Split up setting up the shine-through directories in two steps. First
the directories are only created. That happens before adding the
initial package domains. After publishing the root node we bind the
shine-through directories to the underlying directories.
* This makes adding a package directory with the same name as a
shine-through directory fail in _AddPackageNode() as originally
intended. Since we no longer want it to fail -- the package daemon
will copy the files in the respective directories as part of the
activation process -- we simply skip the directory now. Adjust
_AddPackageNode() and _AddPackageContentRootNode() accordingly.


# 0b45c28c4f69bfb91ecb58dd81bacf5a472d5d5b 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Implement packagefs index (dir) hooks


# 182e58f709cc0d9e0ae0f905874c13dfe38ce516 07-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

NodeListener::NodeChanged(): Provide old value

* Add interface OldNodeAttributes an instance of which is passed to
NodeListener::NodeChanged() to provide the old attribute values
(currently only modification time and file size).
* Also extend PackageLinksListener::PackageLinkNodeChanged() with a
OldNodeAttributes parameter.
* Add OldNodeAttributes implementations for PackageLinkSymlink (inner
class OldAttributes) and UnpackingNode (OldUnpackageNodeAttributes).


# 617ac41c601a395ce3065e44cc8355d792c33765 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Query class and query management in Volume


# 4791f5ebb3bec07d9592b2bc5b461e269880ed3b 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add Index base class and index table in Volume


# ec59ac751529851c81e8c3db96e06ba1b790dcbd 05-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add a global node listener mechanism


# d8ea0a8a31ee4d741497bb8b2b08bd52577b06db 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix package link updates/node monitoring

* PackageLinksListener: Rename methods from *Directory*() to *Node*()
and change parameter to Node*. Also add a *Changed() method.
* PackageLinkDirectory: Update only when necessary and what is necessary
(currently only the self link).


# be1578363cbe7bfd8fe89d2af18344c1ad25920a 24-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume: Remove all package contents on destruction


# fe49869e03e724de875ad54c91f9f66275cfcf32 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add package link directories to system volume

* Add PackageLinksListener interface. It is used by
PackageLink[s]Directory to notify a listener about changes.
* Volume does now implement PackageLinksListener and recursively adds/
removes package link directories.

This makes the package link directories appear at least. They are still
empty.


# 63875d1702406f1bdc0e0f7adaa3492dd9fa3bdd 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add yet empty package-links directory

* Add PackageLinksDirectory Directory subclass. Currently not doing
anything.
* PackageFSRoot: Create a PackageLinksDirectory.
* Volume: Add/remove the package links directory for the system volume.


# 20142717e78e3d349d0da642a8a5ae66a6d0a415 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove package related dependencies from Node

* Move package related methods from Node to new interface UnpackingNode.
* LeafNode and Directory derive from UnpackingNode now.
* Adjust Volume implementation accordingly.


# 1ac0daa99f74f3777b7adc9bd1630a5d7097ed99 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Make Volume::Read{Lock,Unlock} const


# 991ba9fddf31971e08b038b0f84ff165c8cb94b7 23-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

WIP towards packagefs package links support

* Introduce Version class representing a version.
* Introduce Dependency and Resolvable class and add lists of either to
Package.
* Parse package attributes and add dependencies and resolvables to
Package.
* Add a mount type to Volume and add a respective mount parameter
"mount-type" (values "system", "common", "home", "custom"). Also
implies the shine-through type, if that's not given.
* Introduce class PackageFamily which groups equally named and versioned
packages.
* Add class PackageFSRoot. Each instance represents a possible file
system root (separate roots for different chroot environments). Tracks
Volumes belonging to the same root and their packages.


# 6e2af637b947771aa355359a615e6c889a783c6f 21-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Add support for shine-through directories

* packagefs_mount(): Initialize the fs_volume earlier, so it is more
usuable in Volume::Mount().
* The new mount parameter "shine-through" can be used to specify which
shine-through mode shall be used. Can be "system", "common", "home",
and "none". Depending on the setting it is decided which directories
of the underlying file system are bind-mounted on top of ours.
* Fix infinite loop in Volume::_RemovePackageContent().
* Use the RETURN_ERROR() macro in more places to help with debugging.


# 6f8d1ab0891a6914b775269ded62006bed03c8e1 12-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* implement fetching of initial domain from the mount parameters in
order to be able to mount packages from somewhere else than
'/boot/common/packages' (squashes a TODO)
* squashed another TODO about needing to remove nodes of already
installed packages if anything goes wrong during the activation
of a package domain
* fix what to me looks like a bug in Volume::AddPackageDomainJob::Do(),
fDomain is accessed unconditionally in the destructor, so NULLing
it here is bad (it doesn't make sense from a reference-passing POV
either). The problem never showed as this code is never being executed
currently (no way to add additional package domains as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40214 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45bd7bb3db9d9e4dcb02b89a3e7c2bf382c0a88c 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2f59a69a9a84f78d4757367c2084b2015e694d36 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed gcc2 build and warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d73033ce64d4d9b5c6e9831951fecc2398a95ca2 21-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Made PackageDomain BReferenceable.
* LeafNode/Directory: We make sure that the added PackageNode with the newest
modified time is always at the head of the list. This is the package node
whose stat, attribute data and, in case of non-directory nodes, also content
data will be returned. This results in a well-defined algorithm what happens
when multiple directories contain the same file -- the newest file wins.
* Resolved most TODOs regarding error handling when adding a package domain,
package, or package node.
* Volume::_AddPackageContentRootNode(): Fixed the back tracking loop. It would
just continue with siblings of the given root node, causing them to be added
more than once, leading to data structure corruption.
* We now listen to the packages directory. When packages are added or removed
their contents is automatically added/removed to the file system. We don't
listen to the package files themselves yet. I.e. modifying an "installed"
package in place respectively copying/downloading it there will probably not
work correctly.
Due to a limitation in the userlandfs the mechanism works correctly only when
using the kernel module. When running the userland version, one better leaves
the packages directory alone while packagefs is mounted.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34172 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc32c48494415e116417542ddc25bf0d28e616c5 17-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Work in progress:
* The FS parses package files from "/boot/common/packages" and builds an
node tree representation of the contained entries. Merging directories should
work. Lots of other stuff is missing yet, though.
* Implemented the hooks for directory entry lookup and iteration. So it's
possible to see the contents of the FS at least.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34088 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b932032a35bf6775e1b37bc3b39a2c9afa8c3ac1 15-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the most basic functionality required to cleanly mount and unmount
(at least in userlandfs).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34069 a95241bf-73f2-0310-859d-f6bbb57e9c96