mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 22:52:22 +02:00
FileSystem: Move block_size() from DiskBackedFS to FS
Let's just say that all filesystems have a block size, to keep things nice and simple.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 12:45:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c0bfea1b5c3
@@ -10,15 +10,11 @@ public:
|
||||
DiskDevice& device() { return *m_device; }
|
||||
const DiskDevice& device() const { return *m_device; }
|
||||
|
||||
int block_size() const { return m_block_size; }
|
||||
|
||||
virtual void flush_writes() override;
|
||||
|
||||
protected:
|
||||
explicit DiskBackedFS(NonnullRefPtr<DiskDevice>&&);
|
||||
|
||||
void set_block_size(int);
|
||||
|
||||
ByteBuffer read_block(unsigned index) const;
|
||||
ByteBuffer read_blocks(unsigned index, unsigned count) const;
|
||||
|
||||
@@ -26,8 +22,6 @@ protected:
|
||||
bool write_blocks(unsigned index, unsigned count, const ByteBuffer&);
|
||||
|
||||
private:
|
||||
int m_block_size { 0 };
|
||||
NonnullRefPtr<DiskDevice> m_device;
|
||||
|
||||
HashMap<unsigned, ByteBuffer> m_write_cache;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user