mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +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
Notes:
sideshowbarker
2024-07-17 23:02:37 +09:00
Author: https://github.com/supercomputer7
Commit: c33246235a
Pull-request: https://github.com/SerenityOS/serenity/pull/19714
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/Panky-codes
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