From d3070b8da9816e7c3552da1c5740aac0aa74924b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 7 Feb 2010 23:37:53 -0800 Subject: [PATCH] kernel - SWAP CACHE part 15/many - Correct bug in vm.swapcache.maxfilesize * vm.swapcache.maxfilesize was being applied to meta-data as well as file data. It is only supposed to be applied to regular file data. --- sys/vm/vm_swapcache.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_swapcache.c b/sys/vm/vm_swapcache.c index 9fa9a5cc1d..045953c6c8 100644 --- a/sys/vm/vm_swapcache.c +++ b/sys/vm/vm_swapcache.c @@ -259,17 +259,19 @@ vm_swapcache_writing(vm_page_t marker) if (vm_swapcache_test(m)) continue; object = m->object; - if (vm_swapcache_maxfilesize && - object->size > vm_swapcache_maxfilesize >> PAGE_SHIFT) { - continue; - } vp = object->handle; if (vp == NULL) continue; + switch(vp->v_type) { case VREG: if (vm_swapcache_data_enable == 0) continue; + if (vm_swapcache_maxfilesize && + object->size > + (vm_swapcache_maxfilesize >> PAGE_SHIFT)) { + continue; + } break; case VCHR: if (vm_swapcache_meta_enable == 0) -- 2.11.4.GIT