vm: remove secondary cache code
This commit removes the secondary cache code implementation from VM and its usage from libminixfs. It is to be replaced by a new implementation. Change-Id: I8fa3af06330e7604c7e0dd4cbe39d3ce353a05b1
This commit is contained in:
@@ -153,7 +153,7 @@ struct buf *lmfs_get_block(
|
||||
|
||||
int b;
|
||||
static struct buf *bp, *prev_ptr;
|
||||
u64_t yieldid = VM_BLOCKID_NONE, getid = make64(dev, block);
|
||||
u64_t yieldid = VM_BLOCKID_NONE /*, getid = make64(dev, block) */;
|
||||
|
||||
assert(buf_hash);
|
||||
assert(buf);
|
||||
@@ -263,10 +263,12 @@ struct buf *lmfs_get_block(
|
||||
/* If we can satisfy the PREFETCH or NORMAL request
|
||||
* from the vm cache, work is done.
|
||||
*/
|
||||
#if 0
|
||||
if(vm_yield_block_get_block(yieldid, getid,
|
||||
bp->data, fs_block_size) == OK) {
|
||||
return bp;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,9 +282,11 @@ struct buf *lmfs_get_block(
|
||||
* will be overwritten. VM has to forget
|
||||
* about it.
|
||||
*/
|
||||
#if 0
|
||||
if(vmcache) {
|
||||
vm_forgetblock(getid);
|
||||
}
|
||||
#endif
|
||||
} else
|
||||
panic("unexpected only_search value: %d", only_search);
|
||||
|
||||
@@ -393,7 +397,7 @@ void lmfs_invalidate(
|
||||
for (bp = &buf[0]; bp < &buf[nr_bufs]; bp++)
|
||||
if (bp->lmfs_dev == device) bp->lmfs_dev = NO_DEV;
|
||||
|
||||
vm_forgetblocks();
|
||||
/* vm_forgetblocks(); */
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -496,7 +500,7 @@ void lmfs_rw_scattered(
|
||||
/* Transfer failed. */
|
||||
if (i == 0) {
|
||||
bp->lmfs_dev = NO_DEV; /* Invalidate block */
|
||||
vm_forgetblocks();
|
||||
/* vm_forgetblocks(); */
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -595,11 +599,13 @@ void lmfs_set_blocksize(int new_block_size, int major)
|
||||
* - our main FS device isn't a memory device
|
||||
*/
|
||||
|
||||
#if 0
|
||||
vmcache = 0;
|
||||
if(vm_forgetblock(VM_BLOCKID_NONE) != ENOSYS &&
|
||||
may_use_vmcache && major != MEMORY_MAJOR) {
|
||||
vmcache = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -654,7 +660,7 @@ void lmfs_buf_pool(int new_nr_bufs)
|
||||
for (bp = &buf[0]; bp < &buf[nr_bufs]; bp++) bp->lmfs_hash = bp->lmfs_next;
|
||||
buf_hash[0] = front;
|
||||
|
||||
vm_forgetblocks();
|
||||
/* vm_forgetblocks(); */
|
||||
}
|
||||
|
||||
int lmfs_bufs_in_use(void)
|
||||
|
||||
@@ -85,7 +85,6 @@ SRCS+= \
|
||||
vm_map_phys.c \
|
||||
vm_notify_sig.c \
|
||||
vm_umap.c \
|
||||
vm_yield_get_block.c \
|
||||
vm_procctl.c \
|
||||
vprintf.c
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
|
||||
#include "syslib.h"
|
||||
|
||||
#include <minix/vm.h>
|
||||
#include <minix/u64.h>
|
||||
|
||||
/*===========================================================================*
|
||||
* vm_forgetblocks *
|
||||
*===========================================================================*/
|
||||
void vm_forgetblocks(void)
|
||||
{
|
||||
message m;
|
||||
_taskcall(VM_PROC_NR, VM_FORGETBLOCKS, &m);
|
||||
return;
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* vm_forgetblock *
|
||||
*===========================================================================*/
|
||||
int vm_forgetblock(u64_t id)
|
||||
{
|
||||
message m;
|
||||
|
||||
m.VMFB_IDHI = ex64hi(id);
|
||||
m.VMFB_IDLO = ex64lo(id);
|
||||
|
||||
return _taskcall(VM_PROC_NR, VM_FORGETBLOCK, &m);
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* vm_yield_block_get_block *
|
||||
*===========================================================================*/
|
||||
int vm_yield_block_get_block(u64_t yieldid, u64_t getid,
|
||||
void *mem, vir_bytes len)
|
||||
{
|
||||
message m;
|
||||
|
||||
m.VMYBGB_VADDR = mem;
|
||||
m.VMYBGB_GETIDHI = ex64hi(getid);
|
||||
m.VMYBGB_GETIDLO = ex64lo(getid);
|
||||
m.VMYBGB_LEN = len;
|
||||
m.VMYBGB_YIELDIDHI = ex64hi(yieldid);
|
||||
m.VMYBGB_YIELDIDLO = ex64lo(yieldid);
|
||||
|
||||
return _taskcall(VM_PROC_NR, VM_YIELDBLOCKGETBLOCK, &m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user