From patchwork Mon Jun 11 14:06:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10458019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D46AF601A0 for ; Mon, 11 Jun 2018 14:12:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA93C286A0 for ; Mon, 11 Jun 2018 14:12:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B421828762; Mon, 11 Jun 2018 14:12:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 085FB28694 for ; Mon, 11 Jun 2018 14:11:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F4806B029D; Mon, 11 Jun 2018 10:07:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 551606B029E; Mon, 11 Jun 2018 10:07:12 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EF296B029F; Mon, 11 Jun 2018 10:07:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id E88E56B029D for ; Mon, 11 Jun 2018 10:07:11 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id w6-v6so12184496plp.14 for ; Mon, 11 Jun 2018 07:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=shTCii8XN3GaoHud7h6kduHJWwZn5c2W4msLECbUBQ8=; b=p0a3Qhbl3Lhf0tvJq6pB+70hPDhPVwaior1G6Ft6bVBdYXYGWtp+GePUPMNJ/yBhLI 8lK0/u5OzEDAYIWZTXcnomfkI/PZa+BZANuOwkUjj5G1ubNs5Jlnb1HKC+TSf4WqyINI JNRyHObMz2/Tnxa4KE/ljkXGQCPi3YG5MLFdF6g5c5iruXe766PH+xsszkbtblmDiNaH qfRaTnrcubmYqbJHjTK49yiErygVU3vcCFXqEv2Utq5SYrWjxdFeaJlgs/e15v5JtZlg 3tEAuIpgvRNYe0AnmZLW+1V6V7RqujveQu0w/YREr4h9JE7msrpbGWzLJz+BEngPl8kZ xL0g== X-Gm-Message-State: APt69E16kT+4NT8KvIh7tzzOiyvzW2oSad738a2XvU9NcA3pSbKWW+lb d3hDKcpIPcmMU3AV5dUR6G4+/pxSOXDeGDgWORPWmR7je40bGtGNIr8NfIhyXMuqQYLlMupIQu5 POakYQ554Oe0lkHkMm1ojeXSwMtYxdHHJtHwBCEno/W+n24HCtSMBUIU7Eyot4/rsEQ== X-Received: by 2002:a63:ad08:: with SMTP id g8-v6mr14567797pgf.74.1528726031623; Mon, 11 Jun 2018 07:07:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLUI/4CACHxMCjCDtkJiN9S3ILC8bSbBR3UW+yrHK7DQJ7amnczyf2kOzwp8jpEgwnJl028 X-Received: by 2002:a63:ad08:: with SMTP id g8-v6mr14567746pgf.74.1528726030580; Mon, 11 Jun 2018 07:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528726030; cv=none; d=google.com; s=arc-20160816; b=Xf1MYdCbeqqurA7aPA6f0iXRKHLU+OTy7sdzrRAV780/HfZpvzxWvRqSuvnn5cvNQn MUSkr1FqkmZ8evOx8s4sKlPRB6Et9tPeY8iYamTimVQcaQH4b57oPCGeCn+Qwvxd9WjL aTol91dA7Mq9LRyIZzSVy0dsWwb282KfOar4q/q7g25Ogou+iahRxAXmIG/cXVL1w+4A to/q86CQ5wvIPC95XzJHArh81GrfVTqHCaQcZyHEsAvHFFe6r9rOs9Ei6UOzATTa9Qxr 2xGk3I4x9TxG57hrh3GZ25AivJJkuL7ymOuJdYI0chFtrKgTeiUf1SJCAiuWk66yk5Tr Pdyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=shTCii8XN3GaoHud7h6kduHJWwZn5c2W4msLECbUBQ8=; b=CggFtZCWlSBRmTTz5UUROEK+dNC4YpRuTQvaq4nGShWzPgPbbgjq5oCqQ0MAeKx1Uq sLuW4fUMENYXQkMCgUlQPIP1cRrzkAtg/6zAWLfttGvhOgdubyInJzBUfuUYJBOarJR9 0OMvNhwhHOJCIinjEwWUGHQYnj8HfUyVJAxD5WMZPB9TNr19Kuj0j65v5gUuHBcMPoCP 1QcUMI5UEwizE+hk9kgydmCvNvlLAJMi1BikORHPYpHPqxJpSuvPdrZq5HUIHDo5OoNp dZAE0ut78DoKHNVIVaGE6564V4KlkWoUL93HkdHpN3YCAVESdMTSFzaLjedZY180Noiw KaBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=qaqyTOZa; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id a11-v6si23304663pfo.68.2018.06.11.07.07.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 07:07:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=qaqyTOZa; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org 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=shTCii8XN3GaoHud7h6kduHJWwZn5c2W4msLECbUBQ8=; b=qaqyTOZa8VV5F24xAEN/p0VqJ 8pz7p9vrjV+Hm73Sc+0kCD3uYoLjMmA3he5tn2y7ZgcqT0T6b+bN17nN198rjfLBJfmVxTvM020xi V9cYnDAl9vhkBWrtGiFlMZed+i+N20oFrFf+qrksvHPwa3VLncNkvS+Yqmejt1Skr+j5Jo7mdp9kS K3ZIOcnb530aBKd/YrOqtKC/pokoPCAzJ+GCh9Jr1VLFEEVCEI1vHNohk6c7dBHOwjL1Km+I4tiE4 OCEgBa7Th99FU3uNSAQgkdImMsaL8LcOn2/pNpsxbz0GnwonnMSFnJJ27n8HSGksHk0ADp+VIlczu G6ssNnbpQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSNTR-0004zP-8F; Mon, 11 Jun 2018 14:07:09 +0000 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Jan Kara , Jeff Layton , Lukas Czerner , Ross Zwisler , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v13 60/72] f2fs: Convert to XArray Date: Mon, 11 Jun 2018 07:06:27 -0700 Message-Id: <20180611140639.17215-61-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180611140639.17215-1-willy@infradead.org> References: <20180611140639.17215-1-willy@infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox This is a straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/data.c | 4 ++-- fs/f2fs/dir.c | 2 +- fs/f2fs/f2fs.h | 2 +- fs/f2fs/inline.c | 2 +- fs/f2fs/node.c | 6 ++---- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index e5c0b1e74ce6..b274300995cd 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2600,13 +2600,13 @@ const struct address_space_operations f2fs_dblock_aops = { #endif }; -void f2fs_clear_radix_tree_dirty_tag(struct page *page) +void f2fs_clear_page_cache_dirty_tag(struct page *page) { struct address_space *mapping = page_mapping(page); unsigned long flags; xa_lock_irqsave(&mapping->i_pages, flags); - radix_tree_tag_clear(&mapping->i_pages, page_index(page), + __xa_clear_tag(&mapping->i_pages, page_index(page), PAGECACHE_TAG_DIRTY); xa_unlock_irqrestore(&mapping->i_pages, flags); } diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 7f955c4e86a4..9c2a23242f64 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -730,7 +730,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, if (bit_pos == NR_DENTRY_IN_BLOCK && !f2fs_truncate_hole(dir, page->index, page->index + 1)) { - f2fs_clear_radix_tree_dirty_tag(page); + f2fs_clear_page_cache_dirty_tag(page); clear_page_dirty_for_io(page); ClearPagePrivate(page); ClearPageUptodate(page); diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4d8b1de83143..1f71ab2ddad9 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2973,7 +2973,7 @@ int f2fs_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode); #endif bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len); -void f2fs_clear_radix_tree_dirty_tag(struct page *page); +void f2fs_clear_page_cache_dirty_tag(struct page *page); /* * gc.c diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 043830be5662..48f40d344a2a 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -226,7 +226,7 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page) kunmap_atomic(src_addr); set_page_dirty(dn.inode_page); - f2fs_clear_radix_tree_dirty_tag(page); + f2fs_clear_page_cache_dirty_tag(page); set_inode_flag(inode, FI_APPEND_WRITE); set_inode_flag(inode, FI_DATA_EXIST); diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 47d0e64a95a8..44f3974fddf4 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -103,7 +103,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) static void clear_node_page_dirty(struct page *page) { if (PageDirty(page)) { - f2fs_clear_radix_tree_dirty_tag(page); + f2fs_clear_page_cache_dirty_tag(page); clear_page_dirty_for_io(page); dec_page_count(F2FS_P_SB(page), F2FS_DIRTY_NODES); } @@ -1168,9 +1168,7 @@ void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid) if (f2fs_check_nid_range(sbi, nid)) return; - rcu_read_lock(); - apage = radix_tree_lookup(&NODE_MAPPING(sbi)->i_pages, nid); - rcu_read_unlock(); + apage = xa_load(&NODE_MAPPING(sbi)->i_pages, nid); if (apage) return;