mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
Kernel: Move DiskDevice::block_size() up to BlockDevice
All block devices should have a block size, after all. This defaults to PAGE_SIZE if no size is specified.
This commit is contained in:
parent
52366e3f02
commit
5de483cfbb
11 changed files with 23 additions and 45 deletions
|
@ -6,14 +6,18 @@ class BlockDevice : public Device {
|
|||
public:
|
||||
virtual ~BlockDevice() override;
|
||||
|
||||
size_t block_size() const { return m_block_size; }
|
||||
virtual bool is_seekable() const override { return true; }
|
||||
|
||||
protected:
|
||||
BlockDevice(unsigned major, unsigned minor)
|
||||
BlockDevice(unsigned major, unsigned minor, size_t block_size = PAGE_SIZE)
|
||||
: Device(major, minor)
|
||||
, m_block_size(block_size)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
virtual bool is_block_device() const final { return true; }
|
||||
|
||||
size_t m_block_size { 0 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue