Commit Graph

40948 Commits

Author SHA1 Message Date
Ingo Weinhold
9c494559f3 ResolvableFamily: Add ResolveDependency() 2011-11-25 06:18:14 +01:00
Ingo Weinhold
e92a5f2197 Resolvable: Add Version() getter 2011-11-25 06:18:14 +01:00
Ingo Weinhold
e71dd015a5 Add Dependency::ResolvableVersionMatches() 2011-11-25 06:18:13 +01:00
Ingo Weinhold
032ef7b25b Dependency: Add Package() getter 2011-11-25 06:18:13 +01:00
Ingo Weinhold
7d2fa6f0f8 WIP towards dependency package links
* Add ResolvableFamily and DependencyFamily classes for grouping equally
  named resolvables/dependencies.
* Add hash tables to PackageFSRoot to track resolvables and
  dependencies. That is done in {Add,Remove}Package.
* Resolvable does now have a list of Dependency objects, the ones it
  satisfies.
2011-11-25 06:18:12 +01:00
Ingo Weinhold
3068366ed1 Add TODOs regarding broken add/remove behavior 2011-11-25 06:18:11 +01:00
Ingo Weinhold
d8ea0a8a31 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).
2011-11-25 06:18:11 +01:00
Ingo Weinhold
265b7e0dfc Missing locking when adding/removing package nodes 2011-11-25 06:18:10 +01:00
Ingo Weinhold
214d8aec13 Add node monitoring for package link directories 2011-11-25 06:18:10 +01:00
Ingo Weinhold
452b059b3d Reordered methods to match declaration order 2011-11-25 06:18:09 +01:00
Ingo Weinhold
be1578363c Volume: Remove all package contents on destruction 2011-11-25 06:18:07 +01:00
Ingo Weinhold
8c5a05b653 Init fSelfLink 2011-11-25 06:18:07 +01:00
Ingo Weinhold
f985352ef1 Fix Volume::_RemovePackageLinksNode()
Don't use _RemoveNode() as it also removes the node from its parent.
2011-11-25 06:18:06 +01:00
Ingo Weinhold
73d93cd717 Fix NODE_FLAG_OWNS_NAME value 2011-11-25 06:18:06 +01:00
Ingo Weinhold
f9d2e7b39b If none is given pick volume name by mount type 2011-11-25 06:18:05 +01:00
Ingo Weinhold
fcdac38641 Add Node::Init() flags parameter
* Add Node::Init() flags:
  - NODE_FLAG_KEEP_NAME: Take over ownership of the name.
  - NODE_FLAG_CONST_NAME: Don't copy the name -- it's a constant that
    lives at least as long as the object.
* Remove Init() implementations in derived classes that just call the
  base class version.
2011-11-25 06:18:04 +01:00
Ingo Weinhold
d78a784b4b Create self package link 2011-11-25 06:18:04 +01:00
Ingo Weinhold
cc92b95487 PackageLinksDirectory::AddPackage(): Fix check 2011-11-25 06:18:03 +01:00
Ingo Weinhold
f2235ed5bf Empty Node::VFS{Init(),Uninit}() implementations 2011-11-25 06:18:03 +01:00
Ingo Weinhold
fe49869e03 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.
2011-11-25 06:18:02 +01:00
Ingo Weinhold
b5baaa8428 WIP: Create empty package links directories
* Rename PackageFamily to PackageLinkDirectory and derive from
  Directory.
* PackageLinksDirectory: Add the PackageLinkDirectory objects as
  children and remove the no longer needed hash table (we use the
  Directory's child hash table).
2011-11-25 06:18:01 +01:00
Ingo Weinhold
e0b81fa38e Add support function get_real_time() 2011-11-25 06:18:01 +01:00
Ingo Weinhold
d175681861 Move EmptyAttributeDirectoryCookie to own files 2011-11-25 06:18:00 +01:00
Ingo Weinhold
ad9c25bfea Move PackageFamily table to PackageLinksDirectory 2011-11-25 06:18:00 +01:00
Ingo Weinhold
63875d1702 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.
2011-11-25 06:17:59 +01:00
Ingo Weinhold
9e31aaa934 Node: Add setters for ID and parent 2011-11-25 06:17:58 +01:00
Ingo Weinhold
f33a6b765a UnpackingDirectory: Remove unnessary methods
Remove Read() and ReadSymlink() methods which are already implemented in
Directory.
2011-11-25 06:17:58 +01:00
Ingo Weinhold
0da915a909 Update copyright year 2011-11-25 06:17:57 +01:00
Ingo Weinhold
e16ce53bcc Pull derived UnpackingDirectory out of Directory
Move all package specifics from now abstract Directory to new derived
class UnpackingDirectory and adjust the Volume implementation
accordingly. This concludes the Node/Directory refactoring. Neither
class is aware of packages anymore.
2011-11-25 06:17:57 +01:00
Ingo Weinhold
097e795f8e Rename LeafNode to UnpackingLeafNode 2011-11-25 06:17:56 +01:00
Ingo Weinhold
20142717e7 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.
2011-11-25 06:17:55 +01:00
Ingo Weinhold
5167a80703 Attribute dir access kernel interface abstraction
* Introduce interface AttributeDirectoryCookie and currently only
  implementation UnpackingAttributeDirectoryCookie. This is an interface
  for reading/rewinding an attribute directory.
* Add abstract virtual Node::OpenAttributeDirectory() method that
  returns an AttributeDirectoryCookie and implement it for derived
  classes.
* In the kernel interface attribute directory hooks use
  AttributeDirectoryCookie now.
2011-11-25 06:17:55 +01:00
Ingo Weinhold
4ac4d15c3a Move set_dirent_name() to Utils.h 2011-11-25 06:17:54 +01:00
Ingo Weinhold
0e0e9b4575 Remove unused LeafNode::SymlinkPath() 2011-11-25 06:17:54 +01:00
Ingo Weinhold
82c5739d76 Remove unused Node fields 2011-11-25 06:17:53 +01:00
Ingo Weinhold
882b03aba9 Kernel interface abstraction for attribute access
* Introduce interface AttributeCookie and currently only implementation
  UnpackingAttributeCookie. This is an interface for reading/stat()ing
  an attribute.
* Add abstract virtual Node::OpenAttribute() method that returns an
  AttributeCookie and implemented it for derived classes.
* In the kernel interface attribute hooks use AttributeCookie now. The
  attribute directory hooks are unchanged.
2011-11-25 06:17:52 +01:00
Ingo Weinhold
04ea367975 Remove kernel_interface.cpp LeafNode dependency
Introduce abstract virtual Node::ReadSymlink() method that is now used
in packagefs_read_symlink() instead of casting to LeafNode.
2011-11-25 06:17:52 +01:00
Ingo Weinhold
1ac0daa99f Make Volume::Read{Lock,Unlock} const 2011-11-25 06:17:51 +01:00
Ingo Weinhold
991ba9fddf 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.
2011-11-25 06:17:51 +01:00
Ingo Weinhold
cc1dc4db4c Rename Package "name" property to "fileName" 2011-11-25 06:17:50 +01:00
Ingo Weinhold
f1ae591771 Print the package version nicely 2011-11-25 06:17:49 +01:00
Ingo Weinhold
04999b6cf9 Completed vfs_bind_mount_directory() support
We don't need to explicitly track the covered/covering nodes per mount
after all. In fs_unmount() we iterate through all vnodes multiple times
anyway and can deal with the covers/covered_by vnodes there. Also, the
root vnode doesn't need to be handled specially anymore.
2011-11-25 06:17:49 +01:00
Ingo Weinhold
1b08a68a4f vfs_bind_mount_directory(): Fail if unmounting 2011-11-25 06:17:48 +01:00
Ingo Weinhold
8855625e9e fix_dirent(): Fix ref count leaks
* Only get an additional parent reference, when going to call
  vnode_path_to_vnode().
* Put the reference of the vnode vnode_path_to_vnode() returns.
2011-11-25 06:17:47 +01:00
Ingo Weinhold
e4320fd78c remove_vnode(): Also consider covering vnode busy 2011-11-25 06:17:47 +01:00
Ingo Weinhold
bd85d7c7b9 Implement packagefs_get_vnode_name() hook 2011-11-25 06:17:46 +01:00
Ingo Weinhold
7ed608c615 Remove debug output 2011-11-25 06:17:46 +01:00
Ingo Weinhold
6e2af637b9 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.
2011-11-25 06:17:45 +01:00
Ingo Weinhold
54e721afeb Add support for bind-mounting directories
* Add support function vfs_get_mount_point(), so a file system can get
  its own mount point (i.e. the node it covers). Re-added
  fs_mount::covers_vnode for that purpose -- the root node isn't know to
  the VFS before the mount() hook returns.
* Add function vfs_bind_mount_directory() which bind-mounts a directory
  to another. The Vnode::covers/covered_by mechanism is used, so this
  isn't true bind-mounting, but sufficient for what we need ATM and
  cheaper as well. The vnodes connected thus aren't tracked yet, which
  is needed for undoing the connection when unmounting.
* get_vnode_name(): Don't use dir_read() to read the directory. Since we
  have already resolved vnode to the covered vnode, we don't want the
  dirents to be "fixed" to refer to the covering nodes. Such a vnode
  simply wouldn't be found.
2011-11-25 06:17:44 +01:00
Ingo Weinhold
f4a1387cea Add vfs_ prefix to resolve_vnode_to_covering_vnode() 2011-11-25 06:17:44 +01:00