mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
Kernel: Implement bind mounts
You can now bind-mount files and directories. This essentially exposes an
existing part of the file system in another place, and can be used as an
alternative to symlinks or hardlinks.
Here's an example of doing this:
# mkdir /tmp/foo
# mount /home/anon/myfile.txt /tmp/foo -o bind
# cat /tmp/foo
This is anon's file.
This commit is contained in:
committed by
Andreas Kling
parent
71f1d3f819
commit
0cb0f54783
@@ -48,6 +48,7 @@ public:
|
||||
class Mount {
|
||||
public:
|
||||
Mount(FS&, Custody* host_custody, int flags);
|
||||
Mount(Inode& source, Custody& host_custody);
|
||||
|
||||
InodeIdentifier host() const;
|
||||
InodeIdentifier guest() const { return m_guest; }
|
||||
@@ -73,6 +74,7 @@ public:
|
||||
|
||||
bool mount_root(FS&);
|
||||
KResult mount(FS&, Custody& mount_point, int flags);
|
||||
KResult bind_mount(Custody& source, Custody& mount_point);
|
||||
KResult unmount(InodeIdentifier guest_inode_id);
|
||||
|
||||
KResultOr<NonnullRefPtr<FileDescription>> open(StringView path, int options, mode_t mode, Custody& base, Optional<UidAndGid> = {});
|
||||
|
||||
Reference in New Issue
Block a user