Skip to content

Commit

Permalink
Kernel: Remove dead code from BlockDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuta authored and awesomekling committed Nov 4, 2020
1 parent 28b1096 commit 9608101
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
20 changes: 0 additions & 20 deletions Kernel/Devices/BlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
2 changes: 0 additions & 2 deletions Kernel/Devices/BlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class BlockDevice : public Device {

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;
Expand Down

0 comments on commit 9608101

Please sign in to comment.