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 4/4] blockable_page_cache_readahead() cleanup
Date: Tue, 25 Jan 2005 14:59:20 +0300 [thread overview]
Message-ID: <41F63498.72DB416F@tv-sign.ru> (raw)
I think that do_page_cache_readahead() can be inlined
in blockable_page_cache_readahead(), this makes the
code a bit more readable in my opinion.
Also makes check_ra_success() static inline.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 2.6.11-rc2/mm/readahead.c~ 2005-01-25 17:26:34.000000000 +0300
+++ 2.6.11-rc2/mm/readahead.c 2005-01-25 17:29:26.000000000 +0300
@@ -349,8 +349,8 @@ int force_page_cache_readahead(struct ad
* readahead isn't helping.
*
*/
-int check_ra_success(struct file_ra_state *ra, unsigned long nr_to_read,
- unsigned long actual)
+static inline int check_ra_success(struct file_ra_state *ra,
+ unsigned long nr_to_read, unsigned long actual)
{
if (actual == 0) {
ra->cache_hit += nr_to_read;
@@ -395,15 +395,11 @@ blockable_page_cache_readahead(struct ad
{
int actual;
- if (block) {
- actual = __do_page_cache_readahead(mapping, filp,
- offset, nr_to_read);
- } else {
- actual = do_page_cache_readahead(mapping, filp,
- offset, nr_to_read);
- if (actual == -1)
- return 0;
- }
+ if (block && bdi_read_congested(mapping->backing_dev_info))
+ return 0;
+
+ actual = __do_page_cache_readahead(mapping, filp, offset, nr_to_read);
+
return check_ra_success(ra, nr_to_read, actual);
}
next reply other threads:[~2005-01-25 10:57 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:50 ` [PATCH 4/4] blockable_page_cache_readahead() cleanup 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=41F63498.72DB416F@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox