From patchwork Tue Oct 16 18:58:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra D Prabhu X-Patchwork-Id: 1602261 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 877C6DFFED for ; Tue, 16 Oct 2012 18:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755850Ab2JPS6N (ORCPT ); Tue, 16 Oct 2012 14:58:13 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:59205 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755301Ab2JPS6M (ORCPT ); Tue, 16 Oct 2012 14:58:12 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so6259986pbb.19 for ; Tue, 16 Oct 2012 11:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=UU5MZePsS0pWCdYUXoe/IiTqib3RY+15pPEkAsTl8lQ=; b=OasPSMFU56YK+8p88E2CAcWss4ACb+UgYC8iwS1vdi95jFwvYsrHhBrcmcxhfCCQfT wnwYHjgEQRJQZaX4+7Wy4oUSVXKZP+CBHOHJQrIhs+Hc5SndllCVJ6/sLexsWT99Kmsm V3nEeg4PAkFh/GLaA4L3Ve6wQZ40KIeFoJOkkv+YcxBo41lqFC7V8VPZ6JSECUZsQrFR dkyVXb2zV9nF/NvlraQf+nCbt37hS1dJHVrWIjrGVY1dpN/ZMieW5pOQxzSqYWwi0A8i n2jvwgqE/GEMiINOKU7KLF/HLOG+HU41CI5bZKmv67TGsP4yuKHuLKXHerZkQZO167zP qwCg== Received: by 10.68.224.138 with SMTP id rc10mr49449569pbc.34.1350413892415; Tue, 16 Oct 2012 11:58:12 -0700 (PDT) Received: from localhost ([122.167.112.170]) by mx.google.com with ESMTPS id bf6sm5786121pab.3.2012.10.16.11.58.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2012 11:58:11 -0700 (PDT) From: raghu.prabhu13@gmail.com To: zheng.yan@oracle.com, fengguang.wu@intel.com Cc: linux-mm@kvack.org, linux-btrfs@vger.kernel.org, Raghavendra D Prabhu Subject: [PATCH] Change the check for PageReadahead into an else-if Date: Wed, 17 Oct 2012 00:28:05 +0530 Message-Id: <08589dd39c78346ec2ed2fedfd6e3121ca38acda.1350413420.git.rprabhu@wnohang.net> X-Mailer: git-send-email 1.7.12.3 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Raghavendra D Prabhu From 51daa88ebd8e0d437289f589af29d4b39379ea76, page_sync_readahead coalesces async readahead into its readahead window, so another checking for that again is not required. Signed-off-by: Raghavendra D Prabhu Reviewed-by: Fengguang Wu Acked-by: KOSAKI Motohiro --- fs/btrfs/relocation.c | 10 ++++------ mm/filemap.c | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 4da0865..6362003 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2996,12 +2996,10 @@ static int relocate_file_extent_cluster(struct inode *inode, ret = -ENOMEM; goto out; } - } - - if (PageReadahead(page)) { - page_cache_async_readahead(inode->i_mapping, - ra, NULL, page, index, - last_index + 1 - index); + } else if (PageReadahead(page)) { + page_cache_async_readahead(inode->i_mapping, + ra, NULL, page, index, + last_index + 1 - index); } if (!PageUptodate(page)) { diff --git a/mm/filemap.c b/mm/filemap.c index 3843445..d703224 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);