From patchwork Wed Jan 17 20:21:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10172643 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 2A44160230 for ; Thu, 18 Jan 2018 09:46:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D9EE26E1A for ; Thu, 18 Jan 2018 09:46:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0F5274A3; Thu, 18 Jan 2018 09:46:23 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB9C627165 for ; Thu, 18 Jan 2018 09:46:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96D856E5E0; Thu, 18 Jan 2018 09:40:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 368416E1C4 for ; Wed, 17 Jan 2018 20:22:58 +0000 (UTC) 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=T9UHgjsvMOlJWcNj5ey/5z9/Dj+z9dBtLpmY7uJEkvk=; b=p9ZBUcHjxoOT4vHTEr+GphW3B aOEVCj4Nst6P/TLqrXyd3RdffYICpcpkMbZ8H3PaJfw/d448SPTIV3Ix4YPH0VFWLJr2pSglAF8z2 QuADvmuM+rKT5xYepR3DpR29VyUTQemz/QURk0YB84FLkrYOrg419lIuGzR1k6BO44G2RjlSL6Zlb 2KA22ELttKB25lGWMA9DCABNyDXd/lD3PlDwy//yeTY+qC1oQBMT53zCdnmGNx/YmKeCT/wSoKDIT 307KzKBr6jJq1PfxNk8hPhjk+rXy8Syxyol12K1sQu2+5ITkdw3veMyrldFHGFI4dITOsWiJ7h3h8 NgGap2P0Q==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1ebuES-00061O-1t; Wed, 17 Jan 2018 20:22:48 +0000 From: Matthew Wilcox To: linux-kernel@vger.kernel.org Date: Wed, 17 Jan 2018 12:21:19 -0800 Message-Id: <20180117202203.19756-56-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180117202203.19756-1-willy@infradead.org> References: <20180117202203.19756-1-willy@infradead.org> Cc: linux-s390@vger.kernel.org, David Howells , linux-nilfs@vger.kernel.org, Matthew Wilcox , linux-sh@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-usb@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stefano Stabellini , linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, Bjorn Andersson , linux-btrfs@vger.kernel.org Subject: [Intel-gfx] [PATCH v6 55/99] f2fs: Convert to XArray X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox This is a straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/data.c | 3 +-- fs/f2fs/dir.c | 5 +---- fs/f2fs/inline.c | 6 +----- fs/f2fs/node.c | 10 ++-------- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c8f6d9806896..1f3f192f152f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2175,8 +2175,7 @@ void f2fs_set_page_dirty_nobuffers(struct page *page) xa_lock_irqsave(&mapping->pages, flags); WARN_ON_ONCE(!PageUptodate(page)); account_page_dirtied(page, mapping); - radix_tree_tag_set(&mapping->pages, - page_index(page), PAGECACHE_TAG_DIRTY); + __xa_set_tag(&mapping->pages, page_index(page), PAGECACHE_TAG_DIRTY); xa_unlock_irqrestore(&mapping->pages, flags); unlock_page_memcg(page); diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index b5515ea6bb2f..296070016ec9 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -708,7 +708,6 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, unsigned int bit_pos; int slots = GET_DENTRY_SLOTS(le16_to_cpu(dentry->name_len)); struct address_space *mapping = page_mapping(page); - unsigned long flags; int i; f2fs_update_time(F2FS_I_SB(dir), REQ_TIME); @@ -739,10 +738,8 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, if (bit_pos == NR_DENTRY_IN_BLOCK && !truncate_hole(dir, page->index, page->index + 1)) { - xa_lock_irqsave(&mapping->pages, flags); - radix_tree_tag_clear(&mapping->pages, page_index(page), + xa_clear_tag(&mapping->pages, page_index(page), PAGECACHE_TAG_DIRTY); - xa_unlock_irqrestore(&mapping->pages, flags); clear_page_dirty_for_io(page); ClearPagePrivate(page); diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 7858b8e15f33..d3c3f84beca9 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -204,7 +204,6 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page) void *src_addr, *dst_addr; struct dnode_of_data dn; struct address_space *mapping = page_mapping(page); - unsigned long flags; int err; set_new_dnode(&dn, inode, NULL, NULL, 0); @@ -226,10 +225,7 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page) kunmap_atomic(src_addr); set_page_dirty(dn.inode_page); - xa_lock_irqsave(&mapping->pages, flags); - radix_tree_tag_clear(&mapping->pages, page_index(page), - PAGECACHE_TAG_DIRTY); - xa_unlock_irqrestore(&mapping->pages, flags); + xa_clear_tag(&mapping->pages, page_index(page), PAGECACHE_TAG_DIRTY); 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 6b64a3009d55..0a6d5c2f996e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -88,14 +88,10 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type) static void clear_node_page_dirty(struct page *page) { struct address_space *mapping = page->mapping; - unsigned int long flags; if (PageDirty(page)) { - xa_lock_irqsave(&mapping->pages, flags); - radix_tree_tag_clear(&mapping->pages, - page_index(page), + xa_clear_tag(&mapping->pages, page_index(page), PAGECACHE_TAG_DIRTY); - xa_unlock_irqrestore(&mapping->pages, flags); clear_page_dirty_for_io(page); dec_page_count(F2FS_M_SB(mapping), F2FS_DIRTY_NODES); @@ -1142,9 +1138,7 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid) return; f2fs_bug_on(sbi, check_nid_range(sbi, nid)); - rcu_read_lock(); - apage = radix_tree_lookup(&NODE_MAPPING(sbi)->pages, nid); - rcu_read_unlock(); + apage = xa_load(&NODE_MAPPING(sbi)->pages, nid); if (apage) return;