* [PATCH 1/4] readahead: unneeded prev_page assignments
@ 2005-01-29 11:10 Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2005-01-29 11:10 UTC (permalink / raw)
To: linux-kernel; +Cc: Ram Pai, Steven Pratt, Andrew Morton
There is no point in setting ra->prev_page before 'goto out',
it will be overwritten anyway.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 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;
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-29 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-29 11:10 [PATCH 1/4] readahead: unneeded prev_page assignments Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).