mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
Kernel/Storage: Change semantics for addressing block methods
Add a method for matehmatical operations when verifying IO operation boundaries. Also, make max_addressable_block method non-virtual, since no other derived class actually has ever overrided this method.
This commit is contained in:
parent
f3a68fc80d
commit
c33246235a
1 changed files with 6 additions and 1 deletions
|
@ -54,7 +54,12 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
virtual u64 max_addressable_block() const { return m_max_addressable_block; }
|
||||
u64 max_addressable_block() const { return m_max_addressable_block; }
|
||||
|
||||
// NOTE: This method should be used when we need to calculate the actual
|
||||
// end of the storage device, because LBAs start counting at 0, which is not
|
||||
// practical in many cases for verifying IO operation boundaries.
|
||||
u64 max_mathematical_addressable_block() const { return m_max_addressable_block + 1; }
|
||||
|
||||
// ^BlockDevice
|
||||
virtual ErrorOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue