[lc-checkins] CVS: linux/mm/comp_cache swapin.c,1.56,1.57 vswap.c,1.47,1.48
Status: Beta
Brought to you by:
nitin_sf
From: Rodrigo S. de C. <rc...@us...> - 2003-05-19 01:38:55
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory sc8-pr-cvs1:/tmp/cvs-serv25395/mm/comp_cache Modified Files: swapin.c vswap.c Log Message: o Port code to 2.4.20 Bug fix (?) o Changes checks in vswap.c to avoid oopses. It will BUG() instead. Some of the checks were done after the value had been accessed. Note o Virtual swap addresses are temporarily disabled, due to debugging sessions related to the use of swap files instead of swap partitions. Index: swapin.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -r1.56 -r1.57 *** swapin.c 6 Dec 2002 19:29:23 -0000 1.56 --- swapin.c 19 May 2003 01:38:50 -0000 1.57 *************** *** 2,6 **** * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2002-12-06 17:15:44 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2003-05-13 18:58:50 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 157,161 **** /* -- version alair1 -- */ ! /* compact_comp_cache(); */ } else { --- 157,161 ---- /* -- version alair1 -- */ ! compact_comp_cache(); } else { Index: vswap.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** vswap.c 6 Dec 2002 19:29:23 -0000 1.47 --- vswap.c 19 May 2003 01:38:51 -0000 1.48 *************** *** 2,6 **** * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2002-12-03 14:27:24 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/vswap.c * ! * Time-stamp: <2003-05-18 16:09:56 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 172,176 **** int ret = 1; ! spin_lock(&virtual_swap_list); if (comp_cache_available_vswap()) --- 172,179 ---- int ret = 1; ! /* TESTE */ ! return 0; ! ! spin_lock(&virtual_swap_list); if (comp_cache_available_vswap()) *************** *** 207,210 **** --- 210,215 ---- entry.val = 0; + /* TESTE */ + return entry; spin_lock(&virtual_swap_list); *************** *** 300,304 **** vswap = vswap_address[offset]; - fragment = vswap->fragment; if (!vswap) --- 305,308 ---- *************** *** 308,311 **** --- 312,316 ---- BUG(); + fragment = vswap->fragment; swap_count = vswap->swap_count; if (--swap_count) { *************** *** 360,366 **** int ret; fragment = vswap_address[offset]->fragment; ! ret = __virtual_swap_free(offset); ! if (ret) goto out_unlock; --- 365,375 ---- int ret; + if (offset >= vswap_current_num_entries) + BUG(); + if (!vswap_address[offset]) + BUG(); fragment = vswap_address[offset]->fragment; ! ! ret = __virtual_swap_free(offset); if (ret) goto out_unlock; |