serenity/Kernel/Devices/BlockDevice.h

24 lines
528 B
C
Raw Normal View History

2019-02-15 23:52:58 +00:00
#pragma once
#include <Kernel/Devices/Device.h>
2019-02-15 23:52:58 +00:00
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; }
2019-02-15 23:52:58 +00:00
protected:
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 };
2019-02-15 23:52:58 +00:00
};