mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 17:47:18 +00:00
Kernel: Add "child added" and "child removed" InodeWatcher events
The child name is not yet accessible to userspace, but will be in a future patch.
This commit is contained in:
@@ -59,6 +59,7 @@ bool InodeWatcher::can_write(const FileDescription&, size_t) const
|
||||
|
||||
ssize_t InodeWatcher::read(FileDescription&, size_t, u8* buffer, ssize_t buffer_size)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
ASSERT(!m_queue.is_empty() || !m_inode);
|
||||
|
||||
if (!m_inode)
|
||||
@@ -85,7 +86,20 @@ String InodeWatcher::absolute_path(const FileDescription&) const
|
||||
|
||||
void InodeWatcher::notify_inode_event(Badge<Inode>, Event::Type event_type)
|
||||
{
|
||||
m_queue.enqueue({ event_type });
|
||||
LOCKER(m_lock);
|
||||
m_queue.enqueue({ event_type, {} });
|
||||
}
|
||||
|
||||
void InodeWatcher::notify_child_added(Badge<Inode>, const String& child_name)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
m_queue.enqueue({ Event::Type::ChildAdded, child_name });
|
||||
}
|
||||
|
||||
void InodeWatcher::notify_child_removed(Badge<Inode>, const String& child_name)
|
||||
{
|
||||
LOCKER(m_lock);
|
||||
m_queue.enqueue({ Event::Type::ChildRemoved, child_name });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user