[lc-checkins] CVS: linux/mm/comp_cache swapin.c,1.22,1.23 swapout.c,1.28,1.29
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 16:01:15
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv24168/mm/comp_cache
Modified Files:
swapin.c swapout.c
Log Message:
- Fixed annoying bug in the do_generic_file_read(). Wrong variable was sent
as parameter to lookup_comp_cache() which would not find or return the wrong
page.
- Fixed bug in truncate_inode_pages() to correctly truncate compressed
pages.
- Minor fixes regarding setting and clearing CompCache bit.
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** swapin.c 25 Feb 2002 19:34:41 -0000 1.22
--- swapin.c 26 Feb 2002 16:01:10 -0000 1.23
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-25 15:25:38 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-26 11:42:51 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 23,34 ****
int err = find_comp_page(mapping, offset, &fragment);
! if (page)
! PageClearCompCache(page);
!
! if (err)
return;
! if (page && CompFragmentDirty(fragment))
! set_page_dirty(page);
comp_cache_free(fragment);
--- 23,40 ----
int err = find_comp_page(mapping, offset, &fragment);
! if (err) {
! /* if the fragment has been written out, we may have
! * CompCache flag, but no fragment in Comp Cache */
! if (page)
! PageClearCompCache(page);
return;
+ }
! if (page) {
! if (!PageTestandClearCompCache(page))
! BUG();
! if (CompFragmentDirty(fragment))
! set_page_dirty(page);
! }
comp_cache_free(fragment);
***************
*** 96,100 ****
}
SetPageUptodate(page);
- PageSetCompCache(page);
}
--- 102,105 ----
***************
*** 129,132 ****
--- 134,138 ----
comp_cache_free_locked(fragment);
+ PageClearCompCache(page);
UnlockPage(page);
***************
*** 174,177 ****
--- 180,189 ----
void
+ invalidate_comp_pages(struct address_space * mapping)
+ {
+ truncate_list_comp_pages(&mapping->clean_comp_pages, 0, 0);
+ }
+
+ void
lookup_all_comp_pages(struct address_space * mapping)
{
***************
*** 213,217 ****
decompress_fragment(fragment, page);
!
if (!PageDirty(page))
BUG();
--- 225,229 ----
decompress_fragment(fragment, page);
!
if (!PageDirty(page))
BUG();
***************
*** 219,222 ****
--- 231,235 ----
UnlockPage(fragment->comp_page->page);
+ PageSetCompCache(page);
page_cache_release(page);
UnlockPage(page);
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** swapout.c 25 Feb 2002 19:34:41 -0000 1.28
--- swapout.c 26 Feb 2002 16:01:10 -0000 1.29
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-25 16:12:13 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-26 12:53:44 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 351,355 ****
if (!find_comp_page(page->mapping, page->index, &fout)) {
! printk("found %p (index %08lx dirty %d sc %d) new %p (index %08lx dirty %d sc %d)\n", fout, fout->index, CompFragmentDirty(fout)?1:0, PageSwapCache(fragment)?1:0, fragment, fragment->index, CompFragmentDirty(fragment)?1:0, PageSwapCache(fragment)?1:0);
BUG();
}
--- 351,355 ----
if (!find_comp_page(page->mapping, page->index, &fout)) {
! printk("found %p (index %08lx dirty %d sc %d) new %p (index %08lx dirty %d sc %d)\n", fout, fout->index, CompFragmentDirty(fout)?1:0, PageSwapCache(fragment)?1:0, fragment, fragment->index, dirty?1:0, PageSwapCache(fragment)?1:0);
BUG();
}
|