diff --git a/Kernel/FileSystem/DiskBackedFileSystem.cpp b/Kernel/FileSystem/DiskBackedFileSystem.cpp index b6daa759d4..51b193f3b8 100644 --- a/Kernel/FileSystem/DiskBackedFileSystem.cpp +++ b/Kernel/FileSystem/DiskBackedFileSystem.cpp @@ -139,14 +139,6 @@ ByteBuffer DiskBackedFS::read_blocks(unsigned index, unsigned count) const return blocks; } -void DiskBackedFS::set_block_size(int block_size) -{ - ASSERT(block_size > 0); - if (block_size == m_block_size) - return; - m_block_size = block_size; -} - void DiskBackedFS::flush_writes() { LOCKER(m_lock); diff --git a/Kernel/FileSystem/DiskBackedFileSystem.h b/Kernel/FileSystem/DiskBackedFileSystem.h index d1b01e74d8..6221dac829 100644 --- a/Kernel/FileSystem/DiskBackedFileSystem.h +++ b/Kernel/FileSystem/DiskBackedFileSystem.h @@ -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&&); - 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 m_device; - HashMap m_write_cache; }; diff --git a/Kernel/FileSystem/FileSystem.cpp b/Kernel/FileSystem/FileSystem.cpp index d67bbb6821..c0c612c9c9 100644 --- a/Kernel/FileSystem/FileSystem.cpp +++ b/Kernel/FileSystem/FileSystem.cpp @@ -76,3 +76,10 @@ void FS::lock_all() } } +void FS::set_block_size(int block_size) +{ + ASSERT(block_size > 0); + if (block_size == m_block_size) + return; + m_block_size = block_size; +} diff --git a/Kernel/FileSystem/FileSystem.h b/Kernel/FileSystem/FileSystem.h index 18470a7fb5..1e3df8df0f 100644 --- a/Kernel/FileSystem/FileSystem.h +++ b/Kernel/FileSystem/FileSystem.h @@ -61,13 +61,18 @@ public: virtual void flush_writes() {} + int block_size() const { return m_block_size; } + protected: FS(); + void set_block_size(int); + mutable Lock m_lock { "FS" }; private: unsigned m_fsid { 0 }; + int m_block_size { 0 }; bool m_readonly { false }; };