From patchwork Wed Oct 24 21:26:04 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: 1640561 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 7A279DFABE for ; Wed, 24 Oct 2012 21:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758801Ab2JXV0j (ORCPT ); Wed, 24 Oct 2012 17:26:39 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:62448 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755978Ab2JXV0i (ORCPT ); Wed, 24 Oct 2012 17:26:38 -0400 Received: by mail-pa0-f46.google.com with SMTP id hz1so646738pad.19 for ; Wed, 24 Oct 2012 14:26:38 -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=Gx9ipuj1yB+h1aaUVNjx2RJVpnu4hL2a9WwgPNWQ0/0=; b=Hl1Ewr7W4EOlhTW0ccq5T43lzftyYWUQ4m8lvQVpuTdzaWZimV/xoNb4ojVDBu+7qT QSMyge1QvGOnGLB+FF6u8//K8B0Z9oV+Ka4DZjlS28dJe2vFllHq/YpIO6qwE2QNhhUC wX+bye3wPlY5/04TRUTm9fscJUMQVcmAKuYiaVgnFnHGqL2vEsMVoaJs1dEoUCiQa64D wg4eT8FAuDOV3YmfA58QLDL8/75huy4C/086M7yIrRCjdenKWi7IjztG3T4XH6CK7YDm Jhh927c+79qnuzN2x2+CdWOdIDasUo9F90ywpDBjLtk9tNqpXI2KXC9T3ef/mLgwXD5a gIpg== Received: by 10.66.77.168 with SMTP id t8mr47487219paw.28.1351113998082; Wed, 24 Oct 2012 14:26:38 -0700 (PDT) Received: from localhost ([122.167.112.170]) by mx.google.com with ESMTPS id oc6sm2648786pbb.20.2012.10.24.14.26.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 14:26:37 -0700 (PDT) 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 Subject: [PATCH v2] Change the check for PageReadahead into an else-if Date: Thu, 25 Oct 2012 02:56:04 +0530 Message-Id: <05ff4f71283e84be8ab1b312864168d89535239f.1351113536.git.rprabhu@wnohang.net> X-Mailer: git-send-email 1.8.0 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. Version 2: Fixed the incorrect indentation. Signed-off-by: Raghavendra D Prabhu Reviewed-by: Fengguang Wu --- fs/btrfs/relocation.c | 4 +--- mm/filemap.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);