1
Fork 0
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:
Andreas Kling 2019-04-03 12:25:24 +02:00
parent f6d0e1052b
commit f9864940eb
28 changed files with 27 additions and 26 deletions

View 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;
};