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.
This commit is contained in:
@@ -146,6 +146,12 @@ status_t vfs_create_special_node(const char *path, fs_vnode *subVnode,
|
||||
status_t vfs_resolve_vnode_to_covering_vnode(dev_t mountID, ino_t nodeID,
|
||||
dev_t *resolvedMountID, ino_t *resolvedNodeID);
|
||||
|
||||
/* service calls for private file systems */
|
||||
status_t vfs_get_mount_point(dev_t mountID, dev_t* _mountPointMountID,
|
||||
ino_t* _mountPointNodeID);
|
||||
status_t vfs_bind_mount_directory(dev_t mountID, ino_t nodeID,
|
||||
dev_t coveredMountID, ino_t coveredNodeID);
|
||||
|
||||
/* calls the syscall dispatcher should use for user file I/O */
|
||||
dev_t _user_mount(const char *path, const char *device,
|
||||
const char *fs_name, uint32 flags, const char *args,
|
||||
|
||||
Reference in New Issue
Block a user