[lc-checkins] CVS: linux/mm/comp_cache adaptivity.c,1.26,1.27 vswap.c,1.36,1.37
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-06-20 12:34:02
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv25515/mm/comp_cache
Modified Files:
adaptivity.c vswap.c
Log Message:
Bug fix
o Another fix to the vswap failed allocation bug fix. It would BUG() if
there weren't any failed allocation. Also changed last_vswap_allocated from
unsigned int to int to handle the case it can't allocate any vswap entry.
Index: adaptivity.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/adaptivity.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** adaptivity.c 19 Jun 2002 19:32:25 -0000 1.26
--- adaptivity.c 20 Jun 2002 12:33:58 -0000 1.27
***************
*** 2,6 ****
* linux/mm/comp_cache/adaptivity.c
*
! * Time-stamp: <2002-06-19 16:20:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/adaptivity.c
*
! * Time-stamp: <2002-06-20 08:57:04 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 424,427 ****
--- 424,430 ----
}
+ if (!failed_alloc)
+ last_vswap_allocated = vswap_new_num_entries - 1;
+
vfree(vswap_address);
vswap_address = new_vswap_address;
***************
*** 488,492 ****
last_vswap_allocated = i - 1;
}
! }
vfree(vswap_address);
vswap_address = new_vswap_address;
--- 491,499 ----
last_vswap_allocated = i - 1;
}
! }
!
! if (!failed_alloc)
! last_vswap_allocated = vswap_new_num_entries - 1;
!
vfree(vswap_address);
vswap_address = new_vswap_address;
***************
*** 514,517 ****
--- 521,526 ----
}
+ if (!failed_alloc)
+ last_vswap_allocated = vswap_new_num_entries - 1;
vswap_last_used = vswap_current_num_entries - 1;
}
Index: vswap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** vswap.c 19 Jun 2002 19:32:25 -0000 1.36
--- vswap.c 20 Jun 2002 12:33:58 -0000 1.37
***************
*** 2,6 ****
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-06-19 16:11:47 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-06-20 09:04:04 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 54,58 ****
* following position is empty). This index will be used to try to
* allocate in case the vswap addresses are over) */
! unsigned int last_vswap_allocated;
unsigned short * last_page_size;
--- 54,58 ----
* following position is empty). This index will be used to try to
* allocate in case the vswap addresses are over) */
! int last_vswap_allocated;
unsigned short * last_page_size;
***************
*** 77,80 ****
--- 77,81 ----
vswap_num_swap_cache = 0;
+ last_vswap_allocated = NUM_VSWAP_ENTRIES - 1;
for (i = 0; i < NUM_VSWAP_ENTRIES; i++) {
if (!vswap_alloc_and_init(vswap_address, i) && !failed_alloc) {
|