linux/mmnommu/filemap.c
/**
 * truncate_inode_pages - truncate *all* the pages from an offset
 * @mapping: mapping to truncate
 * @lstart: offset from with to truncate
 *
 * Truncate the page cache at a set offset, removing the pages
 * that are beyond that offset (and zeroing out partial pages).
 * If any page is locked we wait for it to become unlocked.
 */
truncate *all* the pages from an offset
@mapping: mapping to truncate
@lstart: offset from with to truncate

Truncate the page cache at a set offset, removing the pages
that are beyond that offset (and zeroing out partial pages).
If any page is locked we wait for it to become unlocked.
truncate * all * the pages from an offset @mapping : mapping to truncate @lstart : offset from with to truncate Truncate the page cache at a set offset removing the pages that are beyond that offset ( and zeroing out partial pages ) . If any page is locked we wait for it to become unlocked .
void truncate_inode_pages(struct address_space * mapping, loff_t lstart) 
{
	unsigned long start = (lstart + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
	unsigned partial = lstart & (PAGE_CACHE_SIZE - 1);
repeat:
	spin_lock(&pagecache_lock);
	if (truncate_list_pages(&mapping->clean_pages, start, &partial))
		goto repeat;
	if (truncate_list_pages(&mapping->dirty_pages, start, &partial))
		goto repeat;
	if (truncate_list_pages(&mapping->locked_pages, start, &partial))
		goto repeat;
	spin_unlock(&pagecache_lock);
}
void truncate_inode_pages ( struct address_space * mapping , loff_t lstart ) { unsigned long start = ( lstart + PAGE_CACHE_SIZE - 1 ) >> PAGE_CACHE_SHIFT ; unsigned partial = lstart & ( PAGE_CACHE_SIZE - 1 ) ; repeat : spin_lock ( & pagecache_lock ) ; if ( truncate_list_pages ( & mapping -> clean_pages , start , & partial ) ) goto repeat ; if ( truncate_list_pages ( & mapping -> dirty_pages , start , & partial ) ) goto repeat ; if ( truncate_list_pages ( & mapping -> locked_pages , start , & partial ) ) goto repeat ; spin_unlock ( & pagecache_lock ) ; }
truncate_inode_pages - truncate *all* the pages from an offset
 @mapping: mapping to truncate
 @lstart: offset from with to truncate
truncate_inode_pages - truncate * all * the pages from an offset @mapping : mapping to truncate @lstart : offset from with to truncate