From patchwork Mon Nov 17 10:36:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 5317301 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17F09C11AC for ; Mon, 17 Nov 2014 10:40:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3980120148 for ; Mon, 17 Nov 2014 10:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B2BA20136 for ; Mon, 17 Nov 2014 10:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752529AbaKQKkt (ORCPT ); Mon, 17 Nov 2014 05:40:49 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:58628 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527AbaKQKhZ (ORCPT ); Mon, 17 Nov 2014 05:37:25 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so1774619pad.23 for ; Mon, 17 Nov 2014 02:37:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=PO5E/WheA6qsUJfEOGjSUBYpfkzVrjvQpK0x9hbzHw0=; b=Uf6hZUUFtx4lAvcTllpSQwB6iAWfvJx4MWuB8nt0B59j46ib488kiv2EhW57sx2Bw9 tnuxrBXhUXA2LOQCzt7xpdSSOhDIRmW4ZdErcrXstQUD2cvNxVWsslJwc+jJqBg5jcUw 16Td8MWmRo6ME/0j8T0YXMbHgZPfht4oOfmQC12VIjSxTavVFcjb/6Gfe0fNQKN/YnzO h8cm/OYpexv8YMOy1048YH9DOqh1L0Vg9H1TP6WEP4CInb3QjAKXoBSHikOzBXo19F/x Zdfzdml1fUh8Lnyn6lfOCvTRnONIRautG3ISt75J3m67PVbJFiEVy3K9uK35AZ5WVCTB JDfA== X-Gm-Message-State: ALoCoQkFlKZ3fhocuGlJmGcyBHxHZutac2m4xcaLMix5W+kNVjMduKso+NKGmBKMSmsYgQtTt1bz X-Received: by 10.68.222.103 with SMTP id ql7mr12919428pbc.58.1416220645447; Mon, 17 Nov 2014 02:37:25 -0800 (PST) Received: from mew.home.network (c-24-19-133-29.hsd1.wa.comcast.net. [24.19.133.29]) by mx.google.com with ESMTPSA id hb6sm34680321pbc.31.2014.11.17.02.37.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 02:37:24 -0800 (PST) From: Omar Sandoval To: linux-btrfs@vger.kernel.org Cc: Mel Gorman , linux-kernel@vger.kernel.org, , Omar Sandoval Subject: [RFC PATCH 4/6] btrfs: don't check the cleancache for swapcache pages Date: Mon, 17 Nov 2014 02:36:57 -0800 Message-Id: X-Mailer: git-send-email 2.1.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Omar Sandoval --- fs/btrfs/extent_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 54b2d00..b8dc256 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2904,13 +2904,14 @@ static int __do_readpage(struct extent_io_tree *tree, size_t disk_io_size; size_t blocksize = inode->i_sb->s_blocksize; unsigned long this_bio_flag = *bio_flags & EXTENT_BIO_PARENT_LOCKED; + int swapcache = PageSwapCache(page); - if (likely(!PageSwapCache(page))) + if (likely(!swapcache)) set_page_extent_mapped(page); end = page_end; if (!PageUptodate(page)) { - if (cleancache_get_page(page) == 0) { + if (likely(!swapcache) && cleancache_get_page(page) == 0) { BUG_ON(blocksize != PAGE_SIZE); unlock_extent(tree, start, end); goto out;