Received: by 10.223.185.116 with SMTP id b49csp4137333wrg; Mon, 19 Feb 2018 11:50:37 -0800 (PST) X-Google-Smtp-Source: AH8x226zbMVYMhQnn2nQL8++ZRhHl40rOIYne6LHdRG0yWtP4+NFrWXlRmV5TRz8RngRGuMRK+SP X-Received: by 2002:a17:902:10d:: with SMTP id 13-v6mr14939143plb.266.1519069836950; Mon, 19 Feb 2018 11:50:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519069836; cv=none; d=google.com; s=arc-20160816; b=oACWo+tJErJfCam3w+ItDV1hQcS8+o2KvSqbGaLX1cZr3DJ4/HgQNQiiGDnmRaHrko 3GMaXfL/TOFB7QVkFDd+XEarDGxiLynwX6Zp/fB0ng5568A7+K+TLbKjBUF2afMb3Tlk 0izSzyaMK3MI/2DkbkJjZXclHdLDw7xjDSVQw6lgG0Rq4aR10V1Kz4x3pSzLlBFyGdJ8 56HJBUrT3iwA/NlZZUHOmYibdM8MZVjTDTzJ4gi+5TqIoTDb+v0VUUsQGFcZy4gtP7Pz bZzK2UeX9++QKcMB7Pk8Ba0Nk4BY0lAQvX7pjfH4Pe9cP6xvHqWqhdoM33iyaKt/5P4/ 3TiQ== 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=pht1Z5II3sPPwIJjF7ntw1REaISp650XZ0bzrUPWNrY=; b=ycv9szW65uSple1IAPhOMVhnYPDZaHmpGqrRZ7YSSC0LuA15FoNEVFQkr8ujLr5H60 bKsiVvHthQ2qiA/eVnSnFbhBc2x98XkOhLXKdztZtDf30HW+Yy5sAaiZqGiUuf+1d8EE mrBUmQePjm+7Be1rB7q9bUgmII6lUtBQ/69mywCJjA2TrlHFXcHFMLikGYtnJ9BmVr/m aM3SOv91rkl1GBdOozYz3/9bh8eAzoifvmkmIcAa0VDPhCfpt+I3R8QLgJiHDrVHCRxI oMDJBD4bUFtE8iJP3pwDRYF/p52kbLx1/bLZcgMy13xOEJR9UtuUNJ8yrOdSeAdsfCv5 L3eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SyPnIxD1; 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 g24-v6si2495778plj.251.2018.02.19.11.50.23; Mon, 19 Feb 2018 11:50:36 -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=SyPnIxD1; 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 S1753912AbeBSTtD (ORCPT + 99 others); Mon, 19 Feb 2018 14:49:03 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:45076 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820AbeBSTqc (ORCPT ); Mon, 19 Feb 2018 14:46:32 -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=pht1Z5II3sPPwIJjF7ntw1REaISp650XZ0bzrUPWNrY=; b=SyPnIxD1vlXjrThh9MvwX4J6q gvmq87P4N7KRUg0/XkwL/3P2bdqNcquGbyrwx5u3EbHFwW3/b3bID5v7Vl+eqt2lgYP/dcCqAhY6v 28rRte0px1c0oBhK3s2/IuVwQdcv/N7sVLW6F6byOFmdBFejeRW6TJLaoyLqWI7M95Jomuo5cKg8f K+DCaGER0bFnEHfw24FCOvvBjLrO0u9K3YBIccICu5hb2zOIwh/m2LWM2yvdIpUMoe+mQ7JrYNNBH NuIlN7bp4GG68VpQtdzzNUgMrg+yIyGTSBu0tlMeXBQWTF9X3aSgnoyPCCbF022o1CuUuJL9dK5Gv FShCHSPkQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1enrOQ-0001xK-JQ; Mon, 19 Feb 2018 19:46:30 +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 58/61] f2fs: Convert to XArray Date: Mon, 19 Feb 2018 11:45:53 -0800 Message-Id: <20180219194556.6575-59-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 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 ce029060acd0..6de3d82377e4 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2384,8 +2384,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 0fd9695eddf6..ab833f624cc2 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); @@ -741,10 +740,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 fba2644abdf0..0c1e9add0952 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); @@ -1139,9 +1135,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; -- 2.16.1