1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Kernel: Move InodeWatcher::Event into Kernel/API/InodeWatcherEvent

This allows userspace code to parse these events.
This commit is contained in:
Itamar 2020-11-07 09:38:48 +02:00 committed by Andreas Kling
parent b4842d33bb
commit 345abc3132
4 changed files with 51 additions and 19 deletions

View file

@ -67,7 +67,7 @@ KResultOr<size_t> InodeWatcher::read(FileDescription&, size_t, UserOrKernelBuffe
auto event = m_queue.dequeue();
if (buffer_size < sizeof(Event))
if (buffer_size < sizeof(InodeWatcherEvent))
return buffer_size;
size_t bytes_to_write = min(buffer_size, sizeof(event));
@ -94,7 +94,7 @@ String InodeWatcher::absolute_path(const FileDescription&) const
return "InodeWatcher:(gone)";
}
void InodeWatcher::notify_inode_event(Badge<Inode>, Event::Type event_type)
void InodeWatcher::notify_inode_event(Badge<Inode>, InodeWatcherEvent::Type event_type)
{
LOCKER(m_lock);
m_queue.enqueue({ event_type });
@ -104,14 +104,14 @@ void InodeWatcher::notify_inode_event(Badge<Inode>, Event::Type event_type)
void InodeWatcher::notify_child_added(Badge<Inode>, const InodeIdentifier& child_id)
{
LOCKER(m_lock);
m_queue.enqueue({ Event::Type::ChildAdded, child_id.index() });
m_queue.enqueue({ InodeWatcherEvent::Type::ChildAdded, child_id.index() });
evaluate_block_conditions();
}
void InodeWatcher::notify_child_removed(Badge<Inode>, const InodeIdentifier& child_id)
{
LOCKER(m_lock);
m_queue.enqueue({ Event::Type::ChildRemoved, child_id.index() });
m_queue.enqueue({ InodeWatcherEvent::Type::ChildRemoved, child_id.index() });
evaluate_block_conditions();
}