kernel: Rename Inode::blocking() to Inode::will_block_if_read()
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
apio 2023-07-30 11:41:53 +02:00
parent 0c873923e8
commit 187f0ff83e
Signed by: apio
GPG Key ID: B8A7D06E42258954
19 changed files with 24 additions and 24 deletions

View File

@ -310,7 +310,7 @@ class ATADevice : public Device
return err(ENOTSUP); return err(ENOTSUP);
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -41,7 +41,7 @@ namespace MBR
Result<usize> write(const u8* buf, usize offset, usize length) override; Result<usize> write(const u8* buf, usize offset, usize length) override;
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -37,7 +37,7 @@ class MountInode : public VFS::Inode, public LinkedListNode<MountInode>
return err(EISDIR); return err(EISDIR);
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -46,7 +46,7 @@ Result<usize> Pipe::write(const u8* buf, usize, usize length)
return length; return length;
} }
bool Pipe::blocking() const bool Pipe::will_block_if_read() const
{ {
return !m_data_buffer.size() && m_writer; return !m_data_buffer.size() && m_writer;
} }

View File

@ -15,7 +15,7 @@ class Pipe : public Shareable
Result<usize> write(const u8* buf, usize, usize length); Result<usize> write(const u8* buf, usize, usize length);
bool blocking() const; bool will_block_if_read() const;
private: private:
Buffer m_data_buffer; Buffer m_data_buffer;
@ -40,9 +40,9 @@ class PipeInodeBase : public VFS::FileInode
return err(ENOTSUP); return err(ENOTSUP);
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return m_pipe->blocking(); return m_pipe->will_block_if_read();
} }
usize size() const override usize size() const override

View File

@ -120,7 +120,7 @@ namespace VFS
virtual Result<void> truncate(usize size) = 0; virtual Result<void> truncate(usize size) = 0;
virtual bool blocking() const = 0; virtual bool will_block_if_read() const = 0;
// Symlink-specific methods // Symlink-specific methods
virtual Result<StringView> readlink() virtual Result<StringView> readlink()
@ -231,7 +231,7 @@ namespace VFS
return 0; return 0;
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -64,7 +64,7 @@ Result<usize> ConsoleDevice::write(const u8* buf, usize, usize length)
return length; return length;
} }
bool ConsoleDevice::blocking() const bool ConsoleDevice::will_block_if_read() const
{ {
return m_may_read_without_blocking ? false : m_input_buffer.size() == 0; return m_may_read_without_blocking ? false : m_input_buffer.size() == 0;
} }

View File

@ -16,7 +16,7 @@ class ConsoleDevice : public Device
static void did_press_or_release_key(u8 scancode); static void did_press_or_release_key(u8 scancode);
bool blocking() const override; bool will_block_if_read() const override;
Result<u64> ioctl(int request, void* arg) override; Result<u64> ioctl(int request, void* arg) override;

View File

@ -41,7 +41,7 @@ class Device : public Shareable
// Path in devfs. // Path in devfs.
virtual StringView device_path() const = 0; virtual StringView device_path() const = 0;
virtual bool blocking() const = 0; virtual bool will_block_if_read() const = 0;
virtual ~Device() = default; virtual ~Device() = default;
}; };

View File

@ -28,7 +28,7 @@ usize FramebufferDevice::size() const
return Framebuffer::size(); return Framebuffer::size();
} }
bool FramebufferDevice::blocking() const bool FramebufferDevice::will_block_if_read() const
{ {
return false; return false;
} }

View File

@ -11,7 +11,7 @@ class FramebufferDevice : public Device
Result<usize> write(const u8*, usize, usize) override; Result<usize> write(const u8*, usize, usize) override;
bool blocking() const override; bool will_block_if_read() const override;
bool is_block_device() const override bool is_block_device() const override
{ {

View File

@ -19,7 +19,7 @@ class FullDevice : public Device
return err(ENOSPC); return err(ENOSPC);
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -17,7 +17,7 @@ class NullDevice : public Device
return 0; return 0;
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -14,7 +14,7 @@ class UARTDevice : public Device
Result<usize> write(const u8*, usize, usize) override; Result<usize> write(const u8*, usize, usize) override;
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -19,7 +19,7 @@ class ZeroDevice : public Device
return 0; return 0;
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -122,7 +122,7 @@ namespace Ext2
return m_entries.size(); return m_entries.size();
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -281,9 +281,9 @@ namespace TmpFS
return m_device->isatty(); return m_device->isatty();
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return m_device->blocking(); return m_device->will_block_if_read();
} }
usize size() const override usize size() const override
@ -385,7 +385,7 @@ namespace TmpFS
return err(EISDIR); return err(EISDIR);
} }
bool blocking() const override bool will_block_if_read() const override
{ {
return false; return false;
} }

View File

@ -12,7 +12,7 @@ class UnixSocket : public Socket
UnixSocket(); UnixSocket();
UnixSocket(UnixSocket* peer); UnixSocket(UnixSocket* peer);
bool blocking() const override bool will_block_if_read() const override
{ {
return (m_state == Connected || m_state == Reset) && !m_data.size(); return (m_state == Connected || m_state == Reset) && !m_data.size();
} }

View File

@ -26,7 +26,7 @@ Result<u64> sys_read(Registers* regs, SyscallArgs args)
if (!descriptor.is_readable()) return err(EBADF); if (!descriptor.is_readable()) return err(EBADF);
while (descriptor.inode()->blocking()) while (descriptor.inode()->will_block_if_read())
{ {
if (descriptor.should_block()) kernel_sleep(10); if (descriptor.should_block()) kernel_sleep(10);
else else