Kernel: Remove dead code from BlockDevice

This commit is contained in:
Tom 2020-11-01 13:43:02 -07:00 committed by Andreas Kling
parent 28b109688b
commit 96081010dc
Notes: sideshowbarker 2024-07-19 01:33:24 +09:00
2 changed files with 0 additions and 22 deletions

View File

@ -42,24 +42,4 @@ bool BlockDevice::write_block(unsigned index, const UserOrKernelBuffer& data)
return write_blocks(index, 1, data);
}
bool BlockDevice::read_raw(u32 offset, unsigned length, UserOrKernelBuffer& out) const
{
ASSERT((offset % block_size()) == 0);
ASSERT((length % block_size()) == 0);
u32 first_block = offset / block_size();
u32 end_block = (offset + length) / block_size();
return const_cast<BlockDevice*>(this)->read_blocks(first_block, end_block - first_block, out);
}
bool BlockDevice::write_raw(u32 offset, unsigned length, const UserOrKernelBuffer& in)
{
ASSERT((offset % block_size()) == 0);
ASSERT((length % block_size()) == 0);
u32 first_block = offset / block_size();
u32 end_block = (offset + length) / block_size();
ASSERT(first_block <= 0xffffffff);
ASSERT(end_block <= 0xffffffff);
return write_blocks(first_block, end_block - first_block, in);
}
}

View File

@ -39,8 +39,6 @@ public:
bool read_block(unsigned index, UserOrKernelBuffer&) const;
bool write_block(unsigned index, const UserOrKernelBuffer&);
bool read_raw(u32 offset, unsigned length, UserOrKernelBuffer&) const;
bool write_raw(u32 offset, unsigned length, const UserOrKernelBuffer&);
virtual bool read_blocks(unsigned index, u16 count, UserOrKernelBuffer&) = 0;
virtual bool write_blocks(unsigned index, u16 count, const UserOrKernelBuffer&) = 0;