1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +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:
Andreas Kling 2019-08-21 16:45:52 +02:00
parent 52366e3f02
commit 5de483cfbb
11 changed files with 23 additions and 45 deletions

View file

@ -5,10 +5,9 @@
class DiskPartition final : public DiskDevice {
public:
static NonnullRefPtr<DiskPartition> create(NonnullRefPtr<DiskDevice>, unsigned block_offset);
static NonnullRefPtr<DiskPartition> create(DiskDevice&, unsigned block_offset);
virtual ~DiskPartition();
virtual unsigned block_size() const override;
virtual bool read_block(unsigned index, u8* out) const override;
virtual bool write_block(unsigned index, const u8*) override;
virtual bool read_blocks(unsigned index, u16 count, u8*) override;
@ -23,7 +22,7 @@ public:
private:
virtual const char* class_name() const override;
DiskPartition(NonnullRefPtr<DiskDevice>, unsigned block_offset);
DiskPartition(DiskDevice&, unsigned block_offset);
NonnullRefPtr<DiskDevice> m_device;
unsigned m_block_offset;