Kernel: Make File's can_read/can_write take a const FileDescription&

Asking a File if we could possibly read or write it will never mutate
the asking FileDescription&, so it should be const.
This commit is contained in:
Andreas Kling 2019-11-04 14:03:14 +01:00
commit 1b2ef8582c
Notes: sideshowbarker 2024-07-19 11:23:46 +09:00
47 changed files with 97 additions and 91 deletions

View file

@ -83,12 +83,12 @@ void FIFO::detach(Direction direction)
}
}
bool FIFO::can_read(FileDescription&) const
bool FIFO::can_read(const FileDescription&) const
{
return !m_buffer.is_empty() || !m_writers;
}
bool FIFO::can_write(FileDescription&) const
bool FIFO::can_write(const FileDescription&) const
{
return m_buffer.bytes_in_write_buffer() < 4096 || !m_readers;
}