mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:25:08 +00:00
BlockDevice -> DiskDevice.
BlockDevice was the wrong name for this abstraction, since a block device is a type of file in a unix system, and we should use that name for that concept in the fs implementation.
This commit is contained in:
parent
72bb80a9ae
commit
9cd0a34b5c
12 changed files with 62 additions and 64 deletions
30
VirtualFileSystem/DiskBackedFileSystem.h
Normal file
30
VirtualFileSystem/DiskBackedFileSystem.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
|
||||
class DiskBackedFileSystem : public FileSystem {
|
||||
public:
|
||||
virtual ~DiskBackedFileSystem() override;
|
||||
|
||||
DiskDevice& device() { return *m_device; }
|
||||
const DiskDevice& device() const { return *m_device; }
|
||||
|
||||
unsigned blockSize() const { return m_blockSize; }
|
||||
|
||||
protected:
|
||||
explicit DiskBackedFileSystem(RetainPtr<DiskDevice>&&);
|
||||
|
||||
void setBlockSize(unsigned);
|
||||
void invalidateCaches();
|
||||
|
||||
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:
|
||||
unsigned m_blockSize { 0 };
|
||||
RetainPtr<DiskDevice> m_device;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue