[PATCH 1/4] readahead: unneeded prev_page assignments
From: Oleg Nesterov
Date: Sat Jan 29 2005 - 05:10:52 EST
There is no point in setting ra->prev_page before 'goto out',
it will be overwritten anyway.
Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
--- 2.6.11-rc2/mm/readahead.c~ Wed Jan 12 11:44:55 2005
+++ 2.6.11-rc2/mm/readahead.c Mon Jan 24 20:19:38 2005
@@ -432,7 +432,6 @@ page_cache_readahead(struct address_spac
if (newsize == 0 || (ra->flags & RA_FLAG_INCACHE)) {
newsize = 1;
- ra->prev_page = offset;
goto out; /* No readahead or file already in cache */
}
/*
@@ -443,7 +442,6 @@ page_cache_readahead(struct address_spac
if ((ra->size == 0 && offset == 0) /* first io and start of file */
|| (ra->size == -1 && ra->prev_page == offset - 1)) {
/* First sequential */
- ra->prev_page = offset + newsize - 1;
ra->size = get_init_ra_size(newsize, max);
ra->start = offset;
if (!blockable_page_cache_readahead(mapping, filp, offset,
@@ -475,7 +473,6 @@ page_cache_readahead(struct address_spac
*/
if ((offset != (ra->prev_page+1) || (ra->size == 0))) {
ra_off(ra);
- ra->prev_page = offset + newsize - 1;
blockable_page_cache_readahead(mapping, filp, offset,
newsize, ra, 1);
goto out;
@@ -545,7 +542,7 @@ page_cache_readahead(struct address_spac
out:
ra->prev_page = offset + newsize - 1;
- return(newsize);
+ return newsize;
}
/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/