Received: by 10.223.185.116 with SMTP id b49csp4138169wrg; Mon, 19 Feb 2018 11:51:45 -0800 (PST) X-Google-Smtp-Source: AH8x227BHNeJ1T9wqxOxD8NebQh66dDwM1NexzR10Q5qmL5XYuetnUv6lXP7jS4HYb6Yluq78X6E X-Received: by 2002:a17:902:8d93:: with SMTP id v19-v6mr1076127plo.371.1519069905796; Mon, 19 Feb 2018 11:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519069905; cv=none; d=google.com; s=arc-20160816; b=mZtiEuAr4o+yCScvbptN0MUHflq9DZI05up1HJWw6UUTNGEwD3VSh6bH3BVE8Kbjj9 nt7fiSwepRk3z2aPyAEGlw6AU8+QZkoppGZE1E43TPhXNxOz7CHMi6lz3T8g/9q00TGm GYpNRTrD7+kvIHTWQi1qY6M/lKhVLyaeSFreN4wEJ2FJfIb4+SbfPUYDBRbnamR/Um8M 3b5JOy8jZnweWGAh0KgMzCeqOEx2cSlfX9giA+mfuZD31CsCPEClgusZUHNIjI9F9cm2 l2O565u4BdWINDIKg6edvyi73BWG1C9ugIvk1Iu1KMrFKSIZ+1XaWE6u7diV4PE30P7o jcqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=2n3TzHF0vxJ0Fsyznf8fTQdcL3oFVzEK6xtsUr/jVDw=; b=Pk7kOOltmfBWKL/3upjrbO3M77/Ikk8ZwYmaAO3tKbWcPOCP1cQaG0zSFYoYcabAVn o2tNp3Y5XCUO3R9O9K2AvAjEYGO9WQdSYDgR4qgXc0MraYLs3IMm+0Fiem7VWUtORXNX /tyxQL8zioxB+Vz7Tf7IzMxAQhCqP5aCAVtp4BRoj+H14VcHbD67UI4lYJ/WymYxzqoU 1kiK0weMeQ2g3R82jeEXpyXcu9FQJY0M5iiP+DmEZseRwsrUgJxXzQ7jvf7M6RRoT00G x6VTsbXsOX0cOUH2cLVgjo7VJ40V9UcXbPVJsCgKqVn4SM0raLeKhCxqqHMTuvnwO3HY hgHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EBSHXPj+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5-v6si7524861pll.88.2018.02.19.11.51.31; Mon, 19 Feb 2018 11:51:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EBSHXPj+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932093AbeBSTtj (ORCPT + 99 others); Mon, 19 Feb 2018 14:49:39 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45046 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753574AbeBSTqa (ORCPT ); Mon, 19 Feb 2018 14:46:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2n3TzHF0vxJ0Fsyznf8fTQdcL3oFVzEK6xtsUr/jVDw=; b=EBSHXPj+jNsU/3nQqKCRSNNXC QE/JJwBMhBSBZl4BwmX/6XHBaqvuDhll0g64dE2mkDhRzura8quXZm4xM8fbd1whAewpXSiNETUzS Tpcv/EdBqrg0rqXuneuypZlw5IhnOTDuEXn6K58252pWjSbP4P/QJAeaQZFFm2CD4vr6txH+iTmcE fiszqrzHFwFYa7D1olmjXv0s8Fv4HpXEYNhAvBSDR/Ju4MmD5k+W5g3ndHBmDfb2g1BCqPW5xGw74 GyiyLW2Wwkg/Oi0dd2xdLkIwyk9t0fnKL62BWl77W/fqpu5kREbOwMstKPnJqKAHtL+9oZ1pQevcZ bJ6ScrStg==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1enrOP-0001wW-3I; Mon, 19 Feb 2018 19:46:29 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v7 54/61] btrfs: Convert page cache to XArray Date: Mon, 19 Feb 2018 11:45:49 -0800 Message-Id: <20180219194556.6575-55-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180219194556.6575-1-willy@infradead.org> References: <20180219194556.6575-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/btrfs/compression.c | 4 +--- fs/btrfs/extent_io.c | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 9fa8617c7344..23867981d016 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -457,9 +457,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, if (pg_index > end_index) break; - rcu_read_lock(); - page = radix_tree_lookup(&mapping->pages, pg_index); - rcu_read_unlock(); + page = xa_load(&mapping->pages, pg_index); if (page && !xa_is_value(page)) { misses++; if (misses > 4) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 54cef60dd79b..02e15093ed57 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -5170,11 +5170,9 @@ void clear_extent_buffer_dirty(struct extent_buffer *eb) clear_page_dirty_for_io(page); xa_lock_irq(&page->mapping->pages); - if (!PageDirty(page)) { - radix_tree_tag_clear(&page->mapping->pages, - page_index(page), + if (!PageDirty(page)) + __xa_clear_tag(&page->mapping->pages, page_index(page), PAGECACHE_TAG_DIRTY); - } xa_unlock_irq(&page->mapping->pages); ClearPageError(page); unlock_page(page); -- 2.16.1