2004-09-03 21:04:09 +04:00
|
|
|
/*
|
2008-07-23 00:36:32 +04:00
|
|
|
* Copyright 2008, 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
|
|
|
|
|
|
|
|
|
2007-09-27 16:21:33 +04:00
|
|
|
#include <vm_types.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);
|
2008-07-23 00:36:32 +04:00
|
|
|
|
|
|
|
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
|
|
|
|
|
|
|
|
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 */
|