mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Kernel: Move FS-related files into Kernel/FileSystem/
This commit is contained in:
parent
f6d0e1052b
commit
f9864940eb
28 changed files with 27 additions and 26 deletions
29
Kernel/FileSystem/DiskBackedFileSystem.h
Normal file
29
Kernel/FileSystem/DiskBackedFileSystem.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
|
||||
class DiskBackedFS : public FS {
|
||||
public:
|
||||
virtual ~DiskBackedFS() override;
|
||||
|
||||
DiskDevice& device() { return *m_device; }
|
||||
const DiskDevice& device() const { return *m_device; }
|
||||
|
||||
int block_size() const { return m_block_size; }
|
||||
|
||||
protected:
|
||||
explicit DiskBackedFS(Retained<DiskDevice>&&);
|
||||
|
||||
void set_block_size(unsigned);
|
||||
|
||||
ByteBuffer read_block(unsigned index) const;
|
||||
ByteBuffer read_blocks(unsigned index, unsigned count) const;
|
||||
|
||||
bool write_block(unsigned index, const ByteBuffer&);
|
||||
bool write_blocks(unsigned index, unsigned count, const ByteBuffer&);
|
||||
|
||||
private:
|
||||
int m_block_size { 0 };
|
||||
Retained<DiskDevice> m_device;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue