Received: by 10.223.148.5 with SMTP id 5csp6339238wrq; Wed, 17 Jan 2018 12:25:56 -0800 (PST) X-Google-Smtp-Source: ACJfBosEX29ys3XWHgJ/Taer0HqYlALPwQ04p/kwqIT8qoCUND3LFsXhxjuqpi8h0ohxfmAVfN2R X-Received: by 10.101.86.4 with SMTP id l4mr22863111pgs.276.1516220756397; Wed, 17 Jan 2018 12:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516220756; cv=none; d=google.com; s=arc-20160816; b=ecY8m/45GAg3Kv8dcPj1aEQFiGw9yrg94OkBv2/2I48wU5A1JWzBtExaxgG3DxHdxU 19Z459xWdijjDg92xGOdyftI4w4a61NNjpNjZyin+m1sAVfWxhWOpYTdVBnB/NB3DRdu rG3XA8nXRyA8PbIBAPfsvK8b9FNduAmyJrEBX126Nfwhw/6n3XhafLyHB5/KG8x+un8z tnIdRGONvsXz73PWFF0xwkVstVL1d5Qr1FDgCtLIoDLzP9QXRktI3/wmjW5P7RfaJ7jT 0nl4zS9KiMqMK3TRUG5ZGv9/jz92gvWMRHLVcso/WOHtge0pchWKHFbbKRCFYKPDjmKb tZcg== 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=47QaJrwnfsmKeZuf8T8agrYaRD6vhVrtV1ISCmk9vzc=; b=HFL+/1cIIGvqKxzSVNqZ7o8sVsjIkRx2KYQvFqvrGNC3MQB1nPqTFdIOJau4cPd92V Cby2HtQ/42AiowS7+H4asRyvLbo1USEQTpRf5kUbifWKbFHCZZn1apcRyv+qBh6+ZtCt oDqH4eQH0Huuvto2K7k1VATExGnT2XWAB7p8mIcxKh9pCxteIMgF/2khJmmLNsWKOZTA vL9XlDkWLlB0sFz/2Roevl8EcAnfaJi1qfWlyaXEZWQ8oFLONNUws3cdT/9VxyoXkVhV +O1zUn3QjNAgffJLZVQbbO4yvHj7Awb24qAevs+GS7A0r2fIERRDiSeYik8cjDqaA++N RL9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=he43x9tj; 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 u12si2659388plm.29.2018.01.17.12.25.42; Wed, 17 Jan 2018 12:25:56 -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=he43x9tj; 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 S1754472AbeAQUY4 (ORCPT + 99 others); Wed, 17 Jan 2018 15:24:56 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:50703 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013AbeAQUXG (ORCPT ); Wed, 17 Jan 2018 15:23:06 -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=47QaJrwnfsmKeZuf8T8agrYaRD6vhVrtV1ISCmk9vzc=; b=he43x9tj/d3ph3vYT4O5hbH37 RxIhchklIfbFPo4Czmtyw6cvKKsyz77MUSBdGYRhdaTi3H4bM5qaRjLOSqfl7KeXnhNmQYAR36BzV 58qprfxRyvyOhYFvln1StLAND0WsjluqASgdu1qIRC/jDbG6gSzBX/b/aBggA041DumYtiogC9IVR 3zE/XQ5xGHenblRWrxFcwLMg0aqqVL+BTshgfIVHuyFZ61QLhGB8wGtN4vYzSotCnEdl0AAEiF4RU yKrgWi05sRK11Swp6gtCFKSVoYmfHg4zXK0O/QN/CwrxzdGRpvR3xB6RbJ4aO2cZ2n24rIWRJzYv8 rlm8TGk0A==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1ebuEj-0006LX-9n; Wed, 17 Jan 2018 20:23:05 +0000 From: Matthew Wilcox To: linux-kernel@vger.kernel.org Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-usb@vger.kernel.org, Bjorn Andersson , Stefano Stabellini , iommu@lists.linux-foundation.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, intel-gfx@lists.freedesktop.org, cgroups@vger.kernel.org, linux-sh@vger.kernel.org, David Howells Subject: [PATCH v6 95/99] f2fs: Convert gclist.iroot to XArray Date: Wed, 17 Jan 2018 12:21:59 -0800 Message-Id: <20180117202203.19756-96-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox Straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/gc.c | 14 +++++++------- fs/f2fs/gc.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index aac1e02f75df..2b33068dc36b 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -417,7 +417,7 @@ static struct inode *find_gc_inode(struct gc_inode_list *gc_list, nid_t ino) { struct inode_entry *ie; - ie = radix_tree_lookup(&gc_list->iroot, ino); + ie = xa_load(&gc_list->iroot, ino); if (ie) return ie->inode; return NULL; @@ -434,7 +434,7 @@ static void add_gc_inode(struct gc_inode_list *gc_list, struct inode *inode) new_ie = f2fs_kmem_cache_alloc(inode_entry_slab, GFP_NOFS); new_ie->inode = inode; - f2fs_radix_tree_insert(&gc_list->iroot, inode->i_ino, new_ie); + xa_store(&gc_list->iroot, inode->i_ino, new_ie, GFP_NOFS); list_add_tail(&new_ie->list, &gc_list->ilist); } @@ -442,7 +442,7 @@ static void put_gc_inode(struct gc_inode_list *gc_list) { struct inode_entry *ie, *next_ie; list_for_each_entry_safe(ie, next_ie, &gc_list->ilist, list) { - radix_tree_delete(&gc_list->iroot, ie->inode->i_ino); + xa_erase(&gc_list->iroot, ie->inode->i_ino); iput(ie->inode); list_del(&ie->list); kmem_cache_free(inode_entry_slab, ie); @@ -989,10 +989,10 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, int ret = 0; struct cp_control cpc; unsigned int init_segno = segno; - struct gc_inode_list gc_list = { - .ilist = LIST_HEAD_INIT(gc_list.ilist), - .iroot = RADIX_TREE_INIT(gc_list.iroot, GFP_NOFS), - }; + struct gc_inode_list gc_list; + + xa_init(&gc_list.iroot); + INIT_LIST_HEAD(&gc_list.ilist); trace_f2fs_gc_begin(sbi->sb, sync, background, get_pages(sbi, F2FS_DIRTY_NODES), diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h index 9325191fab2d..769259b0a4f6 100644 --- a/fs/f2fs/gc.h +++ b/fs/f2fs/gc.h @@ -41,7 +41,7 @@ struct f2fs_gc_kthread { struct gc_inode_list { struct list_head ilist; - struct radix_tree_root iroot; + struct xarray iroot; }; /* -- 2.15.1