[lc-checkins] CVS: linux/mm/comp_cache free.c,1.24,1.25 main.c,1.29,1.30 swapin.c,1.25,1.26 swapout.
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 19:05:08
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv1432/mm/comp_cache
Modified Files:
free.c main.c swapin.c swapout.c
Log Message:
- Some cleanups in mm/filemap.c
- Support for shared memory
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** free.c 25 Feb 2002 19:34:41 -0000 1.24
--- free.c 28 Feb 2002 19:05:04 -0000 1.25
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-25 09:04:00 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-28 15:09:09 rcastro>
*
* Linux Virtual Memory Compressed Cache
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** main.c 27 Feb 2002 19:58:51 -0000 1.29
--- main.c 28 Feb 2002 19:05:05 -0000 1.30
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-27 13:52:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-28 15:29:05 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 86,89 ****
--- 86,101 ----
return ((comp_page_stats.comp_size <= PAGE_SIZE)?comp_page_stats.comp_size:PAGE_SIZE);
+ }
+
+ inline int
+ compress_dirty_page(struct page * page, int (*writepage)(struct page *), unsigned int gfp_mask)
+ {
+ int ret;
+
+ if (likely(!shmem_page(page)))
+ ret = compress_page(page, 1, gfp_mask);
+ else
+ ret = writepage(page);
+ return ret;
}
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** swapin.c 27 Feb 2002 19:58:51 -0000 1.25
--- swapin.c 28 Feb 2002 19:05:05 -0000 1.26
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-27 16:33:10 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-28 15:11:05 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 132,139 ****
goto check_vswap;
! if (TryLockPage(fragment->comp_page->page))
BUG();
!
! if (!page->pprev_hash)
BUG();
--- 132,138 ----
goto check_vswap;
! if (!PageLocked(page))
BUG();
! if (TryLockPage(fragment->comp_page->page))
BUG();
***************
*** 196,200 ****
wait_all_comp_pages(struct address_space * mapping)
{
- struct page **hash;
struct page * page;
--- 195,198 ----
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** swapout.c 27 Feb 2002 19:58:51 -0000 1.31
--- swapout.c 28 Feb 2002 19:05:05 -0000 1.32
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-27 16:27:01 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-28 15:25:52 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 80,84 ****
/* it's not swapped out, so let' free it */
! CompFragmentClearIO(swp_buffer->fragment);
comp_cache_free(swp_buffer->fragment);
--- 80,84 ----
/* it's not swapped out, so let' free it */
! CompFragmentClearIO(swp_buffer->fragment);
comp_cache_free(swp_buffer->fragment);
***************
*** 151,155 ****
UnlockPage(fragment->comp_page->page);
-
return swp_buffer;
}
--- 151,154 ----
***************
*** 227,234 ****
BUG();
! writepage = swp_buffer->page->mapping->a_ops->writepage;
if (!writepage)
! BUG();
writepage(swp_buffer->page);
--- 226,233 ----
BUG();
! writepage = fragment->mapping->a_ops->writepage;
if (!writepage)
! BUG();
writepage(swp_buffer->page);
|