mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:35:07 +00:00
Kernel+Userland: Support remounting filesystems :^)
This makes it possible to change flags of a mount after the fact, with the caveats outlined in the man page.
This commit is contained in:
parent
d395b93b15
commit
3847d00727
8 changed files with 58 additions and 0 deletions
|
@ -91,6 +91,20 @@ KResult VFS::bind_mount(Custody& source, Custody& mount_point, int flags)
|
|||
return KSuccess;
|
||||
}
|
||||
|
||||
KResult VFS::remount(Custody& mount_point, int new_flags)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
|
||||
dbg() << "VFS: Remounting " << mount_point.absolute_path();
|
||||
|
||||
Mount* mount = find_mount_for_guest(mount_point.inode().identifier());
|
||||
if (!mount)
|
||||
return KResult(-ENODEV);
|
||||
|
||||
mount->set_flags(new_flags);
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
KResult VFS::unmount(InodeIdentifier guest_inode_id)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue