kernels/linux-2.6.24/mm/filemap.c
/**
 * add_to_page_cache - add newly allocated pagecache pages
 * @page:	page to add
 * @mapping:	the page's address_space
 * @offset:	page index
 * @gfp_mask:	page allocation mode
 *
 * This function is used to add newly allocated pagecache pages;
 * the page is new, so we can just run SetPageLocked() against it.
 * The other page state flags were set by rmqueue().
 *
 * This function does not add the page to the LRU.  The caller must do that.
 */
add newly allocated pagecache pages
@page:       page to add
@mapping:    the page's address_space
@offset:     page index
@gfp_mask:   page allocation mode

This function is used to add newly allocated pagecache pages;
the page is new, so we can just run SetPageLocked() against it.
The other page state flags were set by rmqueue().

This function does not add the page to the LRU.  The caller must do that.
add newly allocated pagecache pages @page : page to add @mapping : the page ' s address_space @offset : page index @gfp_mask : page allocation mode This function is used to add newly allocated pagecache pages ; the page is new so we can just run SetPageLocked () against it . The other page state flags were set by rmqueue () . This function does not add the page to the LRU . The caller must do that .
int add_to_page_cache(struct page *page, struct address_space *mapping,
		pgoff_t offset, gfp_t gfp_mask)
{
	int error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
	if (error == 0) {
		write_lock_irq(&mapping->tree_lock);
		error = radix_tree_insert(&mapping->page_tree, offset, page);
		if (!error) {
			page_cache_get(page);
			SetPageLocked(page);
			page->mapping = mapping;
			page->index = offset;
			mapping->nrpages++;
			__inc_zone_page_state(page, NR_FILE_PAGES);
		}
		write_unlock_irq(&mapping->tree_lock);
		radix_tree_preload_end();
	}
	return error;
}
int add_to_page_cache ( struct page * page , struct address_space * mapping , pgoff_t offset , gfp_t gfp_mask ) { int error = radix_tree_preload ( gfp_mask & ~ __GFP_HIGHMEM ) ; if ( error == 0 ) { write_lock_irq ( & mapping -> tree_lock ) ; error = radix_tree_insert ( & mapping -> page_tree , offset , page ) ; if ( ! error ) { page_cache_get ( page ) ; SetPageLocked ( page ) ; page -> mapping = mapping ; page -> index = offset ; mapping -> nrpages ++ ; __inc_zone_page_state ( page , NR_FILE_PAGES ) ; } write_unlock_irq ( & mapping -> tree_lock ) ; radix_tree_preload_end ( ) ; } return error ; }
add_to_page_cache - add newly allocated pagecache pages
 @page:       page to add
 @mapping:    the page's address_space
 @offset:     page index
 @gfp_mask:   page allocation mode
add_to_page_cache - add newly allocated pagecache pages @page : page to add @mapping : the page ' s address_space @offset : page index @gfp_mask : page allocation mode