kernels/linux-2.4.0/mm/page_io.c
/*
 * A simple wrapper so the base function doesn't need to enforce
 * that all swap pages go through the swap cache! We verify that:
 *  - the page is locked
 *  - it's marked as being swap-cache
 *  - it's associated with the swap inode
 */
A simple wrapper so the base function doesn't need to enforce
that all swap pages go through the swap cache. We verify that:
- the page is locked
- it's marked as being swap-cache
- it's associated with the swap inode
A simple wrapper so the base function doesn ' t need to enforce that all swap pages go through the swap cache . We verify that : - the page is locked - it ' s marked as being swap - cache - it ' s associated with the swap inode
void rw_swap_page(int rw, struct page *page, int wait)
{
	swp_entry_t entry;
	entry.val = page->index;
	if (!PageLocked(page))
		PAGE_BUG(page);
	if (!PageSwapCache(page))
		PAGE_BUG(page);
	if (page->mapping != &swapper_space)
		PAGE_BUG(page);
	if (!rw_swap_page_base(rw, entry, page, wait))
		UnlockPage(page);
}
void rw_swap_page ( int rw , struct page * page , int wait ) { swp_entry_t entry ; entry . val = page -> index ; if ( ! PageLocked ( page ) ) PAGE_BUG ( page ) ; if ( ! PageSwapCache ( page ) ) PAGE_BUG ( page ) ; if ( page -> mapping != & swapper_space ) PAGE_BUG ( page ) ; if ( ! rw_swap_page_base ( rw , entry , page , wait ) ) UnlockPage ( page ) ; }
A simple wrapper so the base function doesn't need to enforce
 that all swap pages go through the swap cache!
A simple wrapper so the base function doesn ' t need to enforce that all swap pages go through the swap cache!