mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
Kernel: Refactor storage stack with u64 as block index
This commit is contained in:
parent
9a3aa7eb0b
commit
999c57ef2d
4 changed files with 15 additions and 15 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
AsyncBlockDeviceRequest::AsyncBlockDeviceRequest(Device& block_device, RequestType request_type, u32 block_index, u32 block_count, const UserOrKernelBuffer& buffer, size_t buffer_size)
|
||||
AsyncBlockDeviceRequest::AsyncBlockDeviceRequest(Device& block_device, RequestType request_type, u64 block_index, u32 block_count, const UserOrKernelBuffer& buffer, size_t buffer_size)
|
||||
: AsyncDeviceRequest(block_device)
|
||||
, m_block_device(static_cast<BlockDevice&>(block_device))
|
||||
, m_request_type(request_type)
|
||||
|
@ -48,7 +48,7 @@ BlockDevice::~BlockDevice()
|
|||
{
|
||||
}
|
||||
|
||||
bool BlockDevice::read_block(unsigned index, UserOrKernelBuffer& buffer)
|
||||
bool BlockDevice::read_block(u64 index, UserOrKernelBuffer& buffer)
|
||||
{
|
||||
auto read_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Read, index, 1, buffer, 512);
|
||||
switch (read_request->wait().request_result()) {
|
||||
|
@ -69,7 +69,7 @@ bool BlockDevice::read_block(unsigned index, UserOrKernelBuffer& buffer)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool BlockDevice::write_block(unsigned index, const UserOrKernelBuffer& buffer)
|
||||
bool BlockDevice::write_block(u64 index, const UserOrKernelBuffer& buffer)
|
||||
{
|
||||
auto write_request = make_request<AsyncBlockDeviceRequest>(AsyncBlockDeviceRequest::Write, index, 1, buffer, 512);
|
||||
switch (write_request->wait().request_result()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue