From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: Ram Pai <linuxram@us.ibm.com>,
Steven Pratt <slpratt@austin.ibm.com>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH 1/4] page_cache_readahead: unneeded prev_page assignments
Date: Tue, 25 Jan 2005 14:59:10 +0300 [thread overview]
Message-ID: <41F6348E.A1CB395C@tv-sign.ru> (raw)
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;
}
/*
next reply other threads:[~2005-01-25 10:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-25 11:59 Oleg Nesterov [this message]
2005-01-25 21:40 ` [PATCH 1/4] page_cache_readahead: unneeded prev_page assignments Steven Pratt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41F6348E.A1CB395C@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=slpratt@austin.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.