mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:45: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
|
@ -1,30 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
|
||||
class DeviceBackedFileSystem : public FileSystem {
|
||||
public:
|
||||
virtual ~DeviceBackedFileSystem() override;
|
||||
|
||||
BlockDevice& device() { return *m_device; }
|
||||
const BlockDevice& device() const { return *m_device; }
|
||||
|
||||
unsigned blockSize() const { return m_blockSize; }
|
||||
|
||||
protected:
|
||||
explicit DeviceBackedFileSystem(RetainPtr<BlockDevice>&&);
|
||||
|
||||
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<BlockDevice> m_device;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue