From patchwork Tue Feb 4 14:25:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 11364713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3776D13A4 for ; Tue, 4 Feb 2020 14:25:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1BB3920730 for ; Tue, 4 Feb 2020 14:25:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BB3920730 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7F0A76B0006; Tue, 4 Feb 2020 09:25:20 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 595DF6B0005; Tue, 4 Feb 2020 09:25:20 -0500 (EST) 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 34C146B0005; Tue, 4 Feb 2020 09:25:20 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id EE4926B0006 for ; Tue, 4 Feb 2020 09:25:19 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A30EC180AD802 for ; Tue, 4 Feb 2020 14:25:19 +0000 (UTC) X-FDA: 76452667158.29.vest02_2e7660e89252b X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,jack@suse.cz,:willy@infradead.org:linux-fsdevel@vger.kernel.org::jack@suse.cz,RULES_HIT:30054:30090,0,RBL:195.135.220.15:@suse.cz:.lbl8.mailshell.net-62.2.6.2 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: vest02_2e7660e89252b X-Filterd-Recvd-Size: 1575 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Feb 2020 14:25:19 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 18C1CAEEC; Tue, 4 Feb 2020 14:25:18 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 060921E0D13; Tue, 4 Feb 2020 15:25:16 +0100 (CET) From: Jan Kara To: Matthew Wilcox Cc: , , Jan Kara Subject: [PATCH 6/8] idr: Use xas_erase() in ida_destroy() Date: Tue, 4 Feb 2020 15:25:12 +0100 Message-Id: <20200204142514.15826-7-jack@suse.cz> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200204142514.15826-1-jack@suse.cz> References: <20200204142514.15826-1-jack@suse.cz> 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: Explicitely clear marks (and set XA_MARK_FREE) in ida_destroy() by calling xas_erase() instead of relying on xas_store() on implicitely doing this. Signed-off-by: Jan Kara --- lib/idr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/idr.c b/lib/idr.c index c2cf2c52bbde..fd4877fef06d 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -543,7 +543,7 @@ void ida_destroy(struct ida *ida) xas_for_each(&xas, bitmap, ULONG_MAX) { if (!xa_is_value(bitmap)) kfree(bitmap); - xas_store(&xas, NULL); + xas_erase(&xas); } xas_unlock_irqrestore(&xas, flags); }