btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / vm / VMAnonymousNoSwapCache.h
blob7f51e351ac334e5d64fa7dd4cfa001ef487c2601
1 /*
2 * Copyright 2008-2011, 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.
6 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
7 * Distributed under the terms of the NewOS License.
8 */
9 #ifndef _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H
10 #define _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H
13 #include <vm/VMCache.h>
16 class VMAnonymousNoSwapCache : public VMCache {
17 public:
18 virtual ~VMAnonymousNoSwapCache();
20 status_t Init(bool canOvercommit,
21 int32 numPrecommittedPages,
22 int32 numGuardPages,
23 uint32 allocationFlags);
25 virtual status_t Commit(off_t size, int priority);
26 virtual bool HasPage(off_t offset);
28 virtual int32 GuardSize() { return fGuardedSize; }
30 virtual status_t Read(off_t offset, const generic_io_vec *vecs,
31 size_t count,uint32 flags,
32 generic_size_t *_numBytes);
33 virtual status_t Write(off_t offset, const generic_io_vec *vecs,
34 size_t count, uint32 flags,
35 generic_size_t *_numBytes);
37 virtual status_t Fault(struct VMAddressSpace* aspace,
38 off_t offset);
40 virtual void MergeStore(VMCache* source);
42 protected:
43 virtual void DeleteObject();
45 private:
46 bool fCanOvercommit;
47 bool fHasPrecommitted;
48 uint8 fPrecommittedPages;
49 int32 fGuardedSize;
53 #endif /* _KERNEL_VM_STORE_ANONYMOUS_NO_SWAP_H */