linux/mmnommu/filemap.c
/*
 * We combine this with read-ahead to deactivate pages when we
 * think there's sequential IO going on. Note that this is
 * harmless since we don't actually evict the pages from memory
 * but just move them to the inactive list.
 *
 * TODO:
 * - make the readahead code smarter
 * - move readahead to the VMA level so we can do the same
 *   trick with mmap()
 *
 * Rik van Riel, 2000
 */
We combine this with read-ahead to deactivate pages when we
think there's sequential IO going on. Note that this is
harmless since we don't actually evict the pages from memory
but just move them to the inactive list.

- make the readahead code smarter
- move readahead to the VMA level so we can do the same
trick with mmap()

Rik van Riel, 2000
We combine this with read - ahead to deactivate pages when we think there ' s sequential IO going on . Note that this is harmless since we don ' t actually evict the pages from memory but just move them to the inactive list . - make the readahead code smarter - move readahead to the VMA level so we can do the same trick with mmap () Rik van Riel 2000
static void drop_behind(struct file * file, unsigned long index)
{
	struct inode *inode = file->f_dentry->d_inode;
	struct address_space *mapping = inode->i_mapping;
	struct page **hash;
	struct page *page;
	unsigned long start;
	if (!index)
		return;
	if (index > file->f_rawin)
		start = index - file->f_rawin;
	else
		start = 0;
	spin_lock(&pagecache_lock);
	while (--index >= start) {
		hash = page_hash(mapping, index);
		page = __find_page_nolock(mapping, index, *hash);
		if (!page)
			break;
		deactivate_page(page);
	}
	spin_unlock(&pagecache_lock);
}
static void drop_behind ( struct file * file , unsigned long index ) { struct inode * inode = file -> f_dentry -> d_inode ; struct address_space * mapping = inode -> i_mapping ; struct page * * hash ; struct page * page ; unsigned long start ; if ( ! index ) return ; if ( index > file -> f_rawin ) start = index - file -> f_rawin ; else start = 0 ; spin_lock ( & pagecache_lock ) ; while ( -- index >= start ) { hash = page_hash ( mapping , index ) ; page = __find_page_nolock ( mapping , index , * hash ) ; if ( ! page ) break ; deactivate_page ( page ) ; } spin_unlock ( & pagecache_lock ) ; }
We combine this with read-ahead to deactivate pages when we
 think there's sequential IO going on.
We combine this with read - ahead to deactivate pages when we think there ' s sequential IO going on .
/* Nothing to drop-behind if we're on the first page. */ /*
	 * Go backwards from index-1 and drop all pages in the
	 * readahead window. Since the readahead window may have
	 * been increased since the last time we were called, we
	 * stop when the page isn't there.
	 */