2 * Copyright 2008-2016, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
4 * Distributed under the terms of the MIT License.
10 #include <vm/VMCache.h>
13 struct file_cache_ref
;
16 class VMVnodeCache
: public VMCache
{
18 status_t
Init(struct vnode
* vnode
,
19 uint32 allocationFlags
);
21 virtual bool HasPage(off_t offset
);
23 virtual status_t
Read(off_t offset
, const generic_io_vec
* vecs
,
24 size_t count
, uint32 flags
,
25 generic_size_t
* _numBytes
);
26 virtual status_t
Write(off_t offset
, const generic_io_vec
* vecs
,
27 size_t count
, uint32 flags
,
28 generic_size_t
* _numBytes
);
29 virtual status_t
WriteAsync(off_t offset
,
30 const generic_io_vec
* vecs
, size_t count
,
31 generic_size_t numBytes
, uint32 flags
,
32 AsyncIOCallback
* callback
);
33 virtual bool CanWritePage(off_t offset
);
35 virtual status_t
Fault(struct VMAddressSpace
* aspace
,
38 virtual status_t
AcquireUnreferencedStoreRef();
39 virtual void AcquireStoreRef();
40 virtual void ReleaseStoreRef();
42 virtual void Dump(bool showPages
) const;
44 void SetFileCacheRef(file_cache_ref
* ref
)
45 { fFileCacheRef
= ref
; }
46 file_cache_ref
* FileCacheRef() const
47 { return fFileCacheRef
; }
49 void VnodeDeleted() { fVnodeDeleted
= true; }
51 dev_t
DeviceId() const
57 virtual void DeleteObject();
61 file_cache_ref
* fFileCacheRef
;
64 volatile bool fVnodeDeleted
;
68 #endif /* VNODE_STORE_H */