mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
Move VFS sources into Kernel/.
This commit is contained in:
parent
19104570cc
commit
754037874c
49 changed files with 35 additions and 37 deletions
29
Kernel/DiskBackedFileSystem.h
Normal file
29
Kernel/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; }
|
||||
|
||||
size_t blockSize() const { return m_blockSize; }
|
||||
|
||||
protected:
|
||||
explicit DiskBackedFS(RetainPtr<DiskDevice>&&);
|
||||
|
||||
void setBlockSize(unsigned);
|
||||
|
||||
ByteBuffer readBlock(unsigned index) const;
|
||||
ByteBuffer readBlocks(unsigned index, unsigned count) const;
|
||||
|
||||
bool writeBlock(unsigned index, const ByteBuffer&);
|
||||
bool writeBlocks(unsigned index, unsigned count, const ByteBuffer&);
|
||||
|
||||
private:
|
||||
size_t m_blockSize { 0 };
|
||||
RetainPtr<DiskDevice> m_device;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue