2004-09-03 21:04:09 +04:00
|
|
|
/*
|
2009-12-07 17:14:21 +03:00
|
|
|
* Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
2007-09-26 04:20:23 +04:00
|
|
|
* Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de.
|
2004-11-23 06:22:35 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-09-03 21:04:09 +04:00
|
|
|
#ifndef VNODE_STORE_H
|
|
|
|
#define VNODE_STORE_H
|
|
|
|
|
|
|
|
|
2009-12-07 17:14:21 +03:00
|
|
|
#include <vm/VMCache.h>
|
2004-09-03 21:04:09 +04:00
|
|
|
|
|
|
|
|
2008-07-23 00:36:32 +04:00
|
|
|
struct file_cache_ref;
|
|
|
|
|
|
|
|
|
|
|
|
class VMVnodeCache : public VMCache {
|
|
|
|
public:
|
|
|
|
status_t Init(struct vnode *vnode);
|
|
|
|
|
|
|
|
virtual bool HasPage(off_t offset);
|
|
|
|
|
|
|
|
virtual status_t Read(off_t offset, const iovec *vecs, size_t count,
|
2008-10-11 11:30:44 +04:00
|
|
|
uint32 flags, size_t *_numBytes);
|
2008-07-23 00:36:32 +04:00
|
|
|
virtual status_t Write(off_t offset, const iovec *vecs, size_t count,
|
2008-08-19 03:28:34 +04:00
|
|
|
uint32 flags, size_t *_numBytes);
|
|
|
|
virtual status_t WriteAsync(off_t offset, const iovec* vecs,
|
|
|
|
size_t count, size_t numBytes, uint32 flags,
|
|
|
|
AsyncIOCallback* callback);
|
2009-04-20 19:19:41 +04:00
|
|
|
virtual bool CanWritePage(off_t offset);
|
2008-07-23 00:36:32 +04:00
|
|
|
|
2009-12-01 20:27:09 +03:00
|
|
|
virtual status_t Fault(struct VMAddressSpace *aspace, off_t offset);
|
2008-07-23 00:36:32 +04:00
|
|
|
|
|
|
|
virtual status_t AcquireUnreferencedStoreRef();
|
|
|
|
virtual void AcquireStoreRef();
|
|
|
|
virtual void ReleaseStoreRef();
|
|
|
|
|
|
|
|
void SetFileCacheRef(file_cache_ref* ref)
|
|
|
|
{ fFileCacheRef = ref; }
|
|
|
|
file_cache_ref* FileCacheRef() const
|
|
|
|
{ return fFileCacheRef; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct vnode* fVnode;
|
|
|
|
dev_t fDevice;
|
|
|
|
ino_t fInode;
|
|
|
|
file_cache_ref* fFileCacheRef;
|
2004-09-03 21:04:09 +04:00
|
|
|
};
|
|
|
|
|
2008-07-23 00:36:32 +04:00
|
|
|
|
2004-09-03 21:04:09 +04:00
|
|
|
#endif /* VNODE_STORE_H */
|