mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-08 16:55:01 +00:00
Add sync() syscall and a /bin/sync.
It walks all the live Inode objects and flushes pending metadata changes wherever needed. This could be optimized by keeping a separate list of dirty Inodes, but let's not get ahead of ourselves.
This commit is contained in:
@@ -47,13 +47,11 @@ VFS::~VFS()
|
||||
|
||||
auto VFS::makeNode(InodeIdentifier inode) -> RetainPtr<Vnode>
|
||||
{
|
||||
auto metadata = inode.metadata();
|
||||
if (!metadata.isValid())
|
||||
auto core_inode = inode.fs()->get_inode(inode);
|
||||
if (!core_inode)
|
||||
return nullptr;
|
||||
|
||||
auto core_inode = inode.fs()->get_inode(inode);
|
||||
if (core_inode)
|
||||
core_inode->m_metadata = metadata;
|
||||
auto& metadata = core_inode->metadata();
|
||||
|
||||
InterruptDisabler disabler;
|
||||
|
||||
@@ -501,3 +499,8 @@ void VFS::for_each_mount(Function<void(const Mount&)> callback) const
|
||||
callback(*mount);
|
||||
}
|
||||
}
|
||||
|
||||
void VFS::sync()
|
||||
{
|
||||
FS::sync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user