diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-07-02 12:48:08 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-05 12:26:27 +0200 |
commit | 187b785a05041c663b1756e927b72148ef401dbc (patch) | |
tree | 3b46a523689f1152b903a1d78b367d934b76fb8a /Kernel/FileSystem/FileBackedFileSystem.h | |
parent | 0c72a9eda7fe581c2cc03df6d369a15f84c0d877 (diff) | |
download | serenity-187b785a05041c663b1756e927b72148ef401dbc.zip |
Kernel: Split BlockBasedFileSystem off FileBackedFileSystem
FileBackedFileSystem is one that's backed by (mounted from) a file, in other
words one that has a "source" of the mount; that doesn't mean it deals in
blocks. The hierarchy now becomes:
* FS
* ProcFS
* DevPtsFS
* TmpFS
* FileBackedFS
* (future) Plan9FS
* BlockBasedFS
* Ext2FS
Diffstat (limited to 'Kernel/FileSystem/FileBackedFileSystem.h')
-rw-r--r-- | Kernel/FileSystem/FileBackedFileSystem.h | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/Kernel/FileSystem/FileBackedFileSystem.h b/Kernel/FileSystem/FileBackedFileSystem.h index cb9c2d1c7b..1297b8b556 100644 --- a/Kernel/FileSystem/FileBackedFileSystem.h +++ b/Kernel/FileSystem/FileBackedFileSystem.h @@ -28,7 +28,6 @@ #include <Kernel/FileSystem/FileDescription.h> #include <Kernel/FileSystem/FileSystem.h> -#include <Kernel/Forward.h> namespace Kernel { @@ -39,39 +38,15 @@ public: File& file() { return m_file_description->file(); } FileDescription& file_description() { return *m_file_description; } const File& file() const { return m_file_description->file(); } - const FileDescription& file_description() const { return *m_file_description; } - - virtual void flush_writes() override; - - void flush_writes_impl(); - - size_t logical_block_size() const { return m_logical_block_size; }; + FileDescription& file_description() const { return *m_file_description; } protected: explicit FileBackedFS(FileDescription&); - bool read_block(unsigned index, u8* buffer, size_t count, size_t offset = 0, bool allow_cache = true) const; - bool read_blocks(unsigned index, unsigned count, u8* buffer, bool allow_cache = true) const; - - bool raw_read(unsigned index, u8* buffer); - bool raw_write(unsigned index, const u8* buffer); - - bool raw_read_blocks(unsigned index, size_t count, u8* buffer); - bool raw_write_blocks(unsigned index, size_t count, const u8* buffer); - - bool write_block(unsigned index, const u8* buffer, size_t count, size_t offset = 0, bool allow_cache = true); - bool write_blocks(unsigned index, unsigned count, const u8*, bool allow_cache = true); - - size_t m_logical_block_size { 512 }; - private: virtual bool is_file_backed() const override { return true; } - DiskCache& cache() const; - void flush_specific_block_if_needed(unsigned index); - mutable NonnullRefPtr<FileDescription> m_file_description; - mutable OwnPtr<DiskCache> m_cache; }; } |