Received: by 10.213.65.68 with SMTP id h4csp351572imn; Tue, 13 Mar 2018 06:30:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELsZeIVGe8iLYaVIBczZsa3Kikwc4VI5rzp9Us4Vo4vXe7SBjVFIrTdqwBx1yY1velpv4LsT X-Received: by 10.99.0.19 with SMTP id 19mr520714pga.25.1520947843179; Tue, 13 Mar 2018 06:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520947843; cv=none; d=google.com; s=arc-20160816; b=gCck0ijU4RcCBoKOoQyFd8E4LojII6KcSSJaKC2SO+cc5rIUytE9tXMksIkOfWjceq e9I7XnRjdKpe0lllgHNciszJAhb6/BDefq/OpdiPgzgv33e3eIe+6Vxalr9TdzOxNer0 8IfNx2OhX1W1VSn97c8XYBH9fGJPDO+StK0p/AarDYBol4du4mvKyVM7LIftHs8OmFUg u+HvKkXo7JFPa5qkdVJDrtcZ0XeXjd1vIdMKV26/riR00IhdhIyJHGmaS0HbifuKyTwG oR46T5PMHIURxLLJfux6yL+eMAi29J//An3LklI1vk7rbFt70TecXSy1NHRw417qOlhA XJCw== 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=GhZlfTPHHJiPpfSnxpFD0vgaxGZiPr7sjSAMJyjTtro=; b=EqxD1M4qNOsVROpY37tJYz7DauhJfyyO5K7DQL4xCECi5k9ix23EBLnlUSIKMMQG7P A7xZsLP8fDU9bZzLIMMsyQ6qyY52OUoYck3/KZ2K5XTPHhweDsrMBlj63dGTRbjG5Yd/ EFGXETDzrFSnG4jrCYR4Oz6cAvw1xs/e7x/JfWsK8ITcb+MQsL/nRt7Dq2+F/QYCGXVC bS/Vy58olt34KzkYB+YSw12ncL1veBeZjCVi202QVkZ0P11pPWgOQNzYY2btTjrUbhg8 8vWOywluL82bKqu+OLmfiwc8Efo+XOuZeG1pCuDdAj4nuSe6jHIG2snWhqOMh+MKDn+o hjyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XJGDzAfm; 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 r23si104225pgv.368.2018.03.13.06.30.28; Tue, 13 Mar 2018 06:30:43 -0700 (PDT) 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=XJGDzAfm; 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 S932897AbeCMN25 (ORCPT + 99 others); Tue, 13 Mar 2018 09:28:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35638 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932718AbeCMN1I (ORCPT ); Tue, 13 Mar 2018 09:27:08 -0400 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=GhZlfTPHHJiPpfSnxpFD0vgaxGZiPr7sjSAMJyjTtro=; b=XJGDzAfmQWhF1h6/fVKbpRdAu EvL+7mM0hqJxz2eRzof2Nl9LBb8rgxxueHfw9pBlEuBjL98Fo2wvqZHI7yC3dREiIrHeQhCJs+3cq knq92ysQ/OTsqubvJ+F466SlJpZrrfzcRK2AhhiRBRJea07TUW2EZHwYr6Cf1ZvK+Owh2FvkK63/z JxV45S8WccQDz18qu25Y4ecxeQZAQR1Y5zGxdBHA3MBhFP2cTx/YzuZNEp8vyWvMPOjpUFCvf4EhU WEs6Vqpn2ynyUx1dXvtgnspMe6Tx0rr+crFk7z7enfsg7aY22YZn9sho3BKaommnb+i2RZKYXdRA3 7fGGUaE2Q==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1evjxL-0004nI-5E; Tue, 13 Mar 2018 13:27:07 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [PATCH v9 57/61] f2fs: Convert to XArray Date: Tue, 13 Mar 2018 06:26:35 -0700 Message-Id: <20180313132639.17387-58-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180313132639.17387-1-willy@infradead.org> References: <20180313132639.17387-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 dfbccf884d4f..8deac207fbc3 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->i_pages, flags); WARN_ON_ONCE(!PageUptodate(page)); account_page_dirtied(page, mapping); - radix_tree_tag_set(&mapping->i_pages, - page_index(page), PAGECACHE_TAG_DIRTY); + __xa_set_tag(&mapping->i_pages, page_index(page), PAGECACHE_TAG_DIRTY); xa_unlock_irqrestore(&mapping->i_pages, flags); unlock_page_memcg(page); diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index a0aa4dd5a7d4..bf7f33f97fdf 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->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); clear_page_dirty_for_io(page); ClearPagePrivate(page); diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index eb82891e4ab6..de06efb53cef 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->i_pages, flags); - radix_tree_tag_clear(&mapping->i_pages, page_index(page), - PAGECACHE_TAG_DIRTY); - xa_unlock_irqrestore(&mapping->i_pages, flags); + xa_clear_tag(&mapping->i_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 ce912c33b11e..57b444ba988b 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->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); 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)->i_pages, nid); - rcu_read_unlock(); + apage = xa_load(&NODE_MAPPING(sbi)->i_pages, nid); if (apage) return; -- 2.16.1