The Pedigree Project
0.1
src
modules
system
rawfs
RawFsFile.h
1
/*
2
* Copyright (c) 2008-2014, Pedigree Developers
3
*
4
* Please see the CONTRIB file in the root of the source tree for a full
5
* list of contributors.
6
*
7
* Permission to use, copy, modify, and distribute this software for any
8
* purpose with or without fee is hereby granted, provided that the above
9
* copyright notice and this permission notice appear in all copies.
10
*
11
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*/
19
20
#ifndef RAWFS_FILE_H
21
#define RAWFS_FILE_H
22
23
#include "pedigree/kernel/process/Mutex.h"
24
#include "pedigree/kernel/processor/types.h"
25
#include "pedigree/kernel/utilities/Cache.h"
26
#include "pedigree/kernel/utilities/String.h"
27
28
#include "modules/system/vfs/File.h"
29
30
class
Disk
;
31
32
class
RawFsFile
:
public
File
{
33
private
:
35
RawFsFile
(
const
RawFsFile
& file);
36
RawFsFile
& operator=(
const
RawFsFile
&);
37
38
public
:
40
RawFsFile
(
String
name,
class
RawFs
* pFs,
File
* pParent,
Disk
* pDisk);
41
~RawFsFile
();
42
virtual
bool
sync
();
43
virtual
bool
sync
(
size_t
offset,
bool
async);
44
bool
shutdown();
45
46
virtual
uintptr_t
readBlock
(uint64_t location);
47
virtual
void
writeBlock
(uint64_t location, uintptr_t address);
48
virtual
bool
pinBlock
(uint64_t location);
49
virtual
void
unpinBlock
(uint64_t location);
50
51
virtual
size_t
getBlockSize
()
const
;
52
53
virtual
void
fileAttributeChanged() {}
54
55
private
:
56
static
bool
cacheCallback(CacheConstants::CallbackCause cause, uintptr_t location, uintptr_t page,
57
void
* context);
58
Disk
* m_pDisk;
59
Cache
m_PageCache;
60
Mutex
m_PageCacheLock;
61
};
62
63
#endif
Cache
Definition
Cache.h:207
Disk
Definition
Disk.h:35
File
Definition
File.h:75
Mutex
Definition
Mutex.h:56
RawFsFile
Definition
RawFsFile.h:32
RawFsFile::RawFsFile
RawFsFile(const RawFsFile &file)
RawFsFile::getBlockSize
virtual size_t getBlockSize() const
Definition
RawFsFile.cc:87
RawFsFile::pinBlock
virtual bool pinBlock(uint64_t location)
Definition
RawFsFile.cc:164
RawFsFile::sync
virtual bool sync()
Definition
RawFsFile.cc:56
RawFsFile::readBlock
virtual uintptr_t readBlock(uint64_t location)
Definition
RawFsFile.cc:93
RawFsFile::writeBlock
virtual void writeBlock(uint64_t location, uintptr_t address)
Definition
RawFsFile.cc:146
RawFsFile::unpinBlock
virtual void unpinBlock(uint64_t location)
Definition
RawFsFile.cc:172
RawFs
Definition
RawFs.h:33
String
Definition
String.h:43
Generated on Sat Oct 3 2026 06:38:07 for The Pedigree Project by
1.9.8