linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: raghu.prabhu13@gmail.com
To: kosaki.motohiro@gmail.com, fengguang.wu@intel.com, zheng.z.yan@intel.com
Cc: linux-mm@kvack.org, linux-btrfs@vger.kernel.org,
	Raghavendra D Prabhu <rprabhu@wnohang.net>
Subject: [PATCH v2] Change the check for PageReadahead into an else-if
Date: Thu, 25 Oct 2012 02:56:04 +0530	[thread overview]
Message-ID: <05ff4f71283e84be8ab1b312864168d89535239f.1351113536.git.rprabhu@wnohang.net> (raw)

From: Raghavendra D Prabhu <rprabhu@wnohang.net>

>From 51daa88ebd8e0d437289f589af29d4b39379ea76, page_sync_readahead coalesces
async readahead into its readahead window, so another checking for that again is
not required.

Version 2: Fixed the incorrect indentation.

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 fs/btrfs/relocation.c | 4 +---
 mm/filemap.c          | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 776f0aa..8cfa1ab 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2996,9 +2996,7 @@ static int relocate_file_extent_cluster(struct inode *inode,
 				ret = -ENOMEM;
 				goto out;
 			}
-		}
-
-		if (PageReadahead(page)) {
+		} else if (PageReadahead(page)) {
 			page_cache_async_readahead(inode->i_mapping,
 						   ra, NULL, page, index,
 						   last_index + 1 - index);
diff --git a/mm/filemap.c b/mm/filemap.c
index 83efee7..aa440f16 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1113,8 +1113,7 @@ find_page:
 			page = find_get_page(mapping, index);
 			if (unlikely(page == NULL))
 				goto no_cached_page;
-		}
-		if (PageReadahead(page)) {
+		} else if (PageReadahead(page)) {
 			page_cache_async_readahead(mapping,
 					ra, filp, page,
 					index, last_index - index);
--
1.8.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2012-10-24 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 21:26 raghu.prabhu13 [this message]
2012-10-24 23:49 ` Fengguang Wu

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=05ff4f71283e84be8ab1b312864168d89535239f.1351113536.git.rprabhu@wnohang.net \
    --to=raghu.prabhu13@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=kosaki.motohiro@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rprabhu@wnohang.net \
    --cc=zheng.z.yan@intel.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