From: Jeff Moyer filemap_nopage has the following code: retry_all: size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; if (pgoff >= size) goto outside_data_content; /* If we don't want any read-ahead, don't bother */ if (VM_RandomReadHint(area)) goto no_cached_page; /* * The "size" of the file, as far as mmap is concerned, isn't bigger * than the mapping */ if (size > endoff) size = endoff; After this, size is not referenced. So, either this potential reassignment of size is superfluous, or we are missing some other code later on in the function. If it is the former, I've attached a patch which will remove the code. (akpm: and endoff can go away too. That was the unused variable which gcc has been warning about for ages. Also, gratuitous whitespace fiddling). Signed-off-by: Andrew Morton --- 25-akpm/mm/filemap.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff -puN mm/filemap.c~unused-size-assignment-in-filemap_nopage mm/filemap.c --- 25/mm/filemap.c~unused-size-assignment-in-filemap_nopage 2005-03-23 12:35:33.000000000 -0800 +++ 25-akpm/mm/filemap.c 2005-03-23 12:35:33.000000000 -0800 @@ -1167,7 +1167,8 @@ static int fastcall page_cache_read(stru * it in the page cache, and handles the special cases reasonably without * having a lot of duplicated code. */ -struct page * filemap_nopage(struct vm_area_struct * area, unsigned long address, int *type) +struct page *filemap_nopage(struct vm_area_struct *area, + unsigned long address, int *type) { int error; struct file *file = area->vm_file; @@ -1175,11 +1176,10 @@ struct page * filemap_nopage(struct vm_a struct file_ra_state *ra = &file->f_ra; struct inode *inode = mapping->host; struct page *page; - unsigned long size, pgoff, endoff; + unsigned long size, pgoff; int did_readaround = 0, majmin = VM_FAULT_MINOR; - pgoff = ((address - area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff; - endoff = ((area->vm_end - area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff; + pgoff = ((address-area->vm_start) >> PAGE_CACHE_SHIFT) + area->vm_pgoff; retry_all: size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; @@ -1191,13 +1191,6 @@ retry_all: goto no_cached_page; /* - * The "size" of the file, as far as mmap is concerned, isn't bigger - * than the mapping - */ - if (size > endoff) - size = endoff; - - /* * The readahead code wants to be told about each and every page * so it can build and shrink its windows appropriately * _