swapfile blocks are now put on a free list and properly reused, so it no longer grows out of control. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@626 a95241bf-73f2-0310-859d-f6bbb57e9c96
22 lines
523 B
C++
22 lines
523 B
C++
#include <unistd.h>
|
|
#include <fcntl.h>
|
|
#include "vm.h"
|
|
#include "OS.h"
|
|
|
|
class swapFileManager {
|
|
private:
|
|
int swapFile;
|
|
unsigned long maxNode;
|
|
list swapFileFreeList;
|
|
sem_id lockFreeList;
|
|
|
|
public:
|
|
swapFileManager (void);
|
|
vnode &findNode(void); // Get an unused node
|
|
void freeVNode(vnode &); // Free a node
|
|
void write_block(vnode &node,void *loc,unsigned long size);
|
|
void read_block(vnode &node,void *loc,unsigned long size);
|
|
void Lock() {acquire_sem(lockFreeList);}
|
|
void Unlock() {release_sem(lockFreeList);}
|
|
};
|