Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1985238pxx; Sat, 31 Oct 2020 04:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDxFRH5IkrRvO/L2L4T9cAE6Zz5DvY5HlgrjUgIHwSxN3ZNa3tyMwnnK5/S0W5wDnuiNau X-Received: by 2002:a50:fc0c:: with SMTP id i12mr6974338edr.373.1604145167926; Sat, 31 Oct 2020 04:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604145167; cv=none; d=google.com; s=arc-20160816; b=eLYtgzLvvgccLAnnP7jXQ1qwg7jLunS/q478RaxgoK3ekvpGgPw2eieXebcDr5KTMa mDBjJ74yfLNG7AOz+R6cs+s80p1PwVC4lNp4VuEs9XoFuwPWDtZ2pYUHPdPuuN6UGXh9 3qffjxAIh6ldWrl0v0ZhgmDKyio+xPPzvV0W1O+5aWb+UMuoDhWNVnk9gvqtiU0Io3/B pCYv9BihqjeiyPRcsnYc25iWbt5N+0YWBSK0o6SqDLGkoJRl48ng7KtI28rHhp4IS0Ad 2wCjItkg0pCEQUQPznTmy3/zQ7QMx+HVO/LoymmFNPgLpwnl0Zlj1G0CVAtlFvabSnzl 8J0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tiFxCR0nn4gYi1Fou97u2uDgV5SR0hDDnL3PUDvXGMY=; b=FhZRxxy5iI7LpM2ZmOAvsesuJusIvUm+O0mJIsdnsK3h8S1zZr5TruMtUf2P5jHHCq CiVtHn+gVXv27OjqPbJS9sVHWiqALKYP2rnnkahfIanwMHQsLXUKiF9fNnU2nAItW5PR bNIuMFTFqGy4Fm0aOjz6WhYRAfvkuGJlHnFXhne0QL78ntr3RuFs6OZJDHwcH1zSSXLu 1TuJh9ygly9ZsMLddkgQAdNPJJP9gyRi+dRSo5I5Sb4MLH2nwj0d7NsDrn0Im974UZ23 sfLKAlJkPXd5K0rUN6do3NiTDU4WAP6hbJMfC4+0Pq5hA3t1K51X7ltGNqva5WDzPzDh EKUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KTM4zg7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si6908776edz.107.2020.10.31.04.52.25; Sat, 31 Oct 2020 04:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KTM4zg7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbgJaLvF (ORCPT + 99 others); Sat, 31 Oct 2020 07:51:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:39200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727425AbgJaLkb (ORCPT ); Sat, 31 Oct 2020 07:40:31 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C446720719; Sat, 31 Oct 2020 11:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144431; bh=2qmKlyrce1/VdJfv1GImth9seO9GFcC//1Ed/4rXr34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KTM4zg7coC2D2q2WU38uVqvjuiFhuhQWk3Ry//dtRj5kb8j12rjNrTMCX0Yhznpxi G0q4vUY9I4Qvih+rD8ftUi32vaT0/BcVRoeUbK7fdq3QlenyHyxuxVlisjxVNb60gv djmZxma2MUaKzV8JFeGIH4FMmn8fkzg862Ia/tPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Matthew Wilcox (Oracle)" , Jens Axboe Subject: [PATCH 5.8 16/70] io_uring: Convert advanced XArray uses to the normal API Date: Sat, 31 Oct 2020 12:35:48 +0100 Message-Id: <20201031113500.284498737@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Matthew Wilcox (Oracle)" commit 5e2ed8c4f45093698855b1f45cdf43efbf6dd498 upstream. There are no bugs here that I've spotted, it's just easier to use the normal API and there are no performance advantages to using the more verbose advanced API. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- fs/io_uring.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -7958,27 +7958,17 @@ static int io_uring_add_task_file(struct static void io_uring_del_task_file(struct file *file) { struct io_uring_task *tctx = current->io_uring; - XA_STATE(xas, &tctx->xa, (unsigned long) file); if (tctx->last == file) tctx->last = NULL; - - xas_lock(&xas); - file = xas_store(&xas, NULL); - xas_unlock(&xas); - + file = xa_erase(&tctx->xa, (unsigned long)file); if (file) fput(file); } static void __io_uring_attempt_task_drop(struct file *file) { - XA_STATE(xas, ¤t->io_uring->xa, (unsigned long) file); - struct file *old; - - rcu_read_lock(); - old = xas_load(&xas); - rcu_read_unlock(); + struct file *old = xa_load(¤t->io_uring->xa, (unsigned long)file); if (old == file) io_uring_del_task_file(file);