Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1674733rdb; Thu, 25 Jan 2024 02:53:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJHmAln7vnUzang2qtwH/IjQcdS8adKHieXeXQoHWKqPFP9jrM+T4HI+keD+1zgKT6/mu0 X-Received: by 2002:a05:6512:1092:b0:510:cfa:994f with SMTP id j18-20020a056512109200b005100cfa994fmr522728lfg.100.1706180027334; Thu, 25 Jan 2024 02:53:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706180027; cv=pass; d=google.com; s=arc-20160816; b=R1GcCj9NS1mShi7ET9//47lC36OUhsBNsJErHzIvw0MPI6F3r8oNr6ERuZk/wEubZe voSPep84j+sYwzR8wP37XsUsc592ZXSq9E6SgxxtztrlbafVmNxmXSwdFoagnoFUqa44 pcu4k7dm046SewY8Qo8emBzW0zQsJdDp/cTTA2mrO7dXScp9BP4C9gpv/FTySw3AEEUs 1C8oqVlsRdRv9PosfgqUtvRiJhxsThi7eX2YF7BG4KHP46cziXHVJlldM5/+N2nGjRBw EUef5A9cT9nDcBorui6yW9mxmKMrYB6oipH7dhZgAhAgH7E03KNDUErOC7UbD0tjnwZ6 bHEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=vj7zVyuKAH50TCb39cGflBVeMwo0/gcb8lyG5Xvn12M=; fh=AED2lrIQZhdppGHbaRrNz6/BI48B+mbutB2egpFPmJc=; b=FLxmvL7cXYxYzS2VG86uwIz0bvoWurQqhZYDcsOeQh+OZ8Fcon8Jw+57jHUP2XrWgH E9zPI/4IhAS0E0JtvLVflOvCZx67o+cMQDIehyhWGa2hoTUB/qGGRw6Whlu+cF0c8Sij f6U5SLD4A0Ry/KCQHQEGMww/cR+4+r9JYn2aaF63EibExVsGNoBOP0lS7foVqBZZrURj mpVv0pC8czOIMos0RMjYqunnUswkt/81SJVZs7YsGfX1fnrAwZfuo0w6gVDo02I35ScA IQwI5Eu6FurF6HJUuhalcTNYCYwKQ6AVNyuSd6MkJWU3fc66S9gSifhdYkL39ay3J+mL kFAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tiiyjDvd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x9-20020a1709064a8900b00a3125648ba0si873226eju.885.2024.01.25.02.53.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 02:53:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tiiyjDvd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 10FFC1F21130 for ; Thu, 25 Jan 2024 10:53:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93BBE33CCC; Thu, 25 Jan 2024 10:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tiiyjDvd" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E64E604BC; Thu, 25 Jan 2024 10:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179460; cv=none; b=FWrqAj6+z/RRAxSmMp7zeLYvJTkTLKtjFFG0YHRsSihyMtzAID0iBxMV0iyEK3F+6SqFK2ge09gyceuX37IaXZNr7hEzPuay42aJ5W+7N9C7G3NXyXIwDMn4qA2CfjUW1UkzS8gsFH7Kxp48eeBXrDGrc5Y2RJsyH2HuNbff/nU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179460; c=relaxed/simple; bh=30KJx0Hyv2s41cGRszMYoB7mdxNuB2UrCQt/ZqfUUKs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WqHdzpfksHTXzrIKxNOG5Lr5xcNWnhRBmuoznlLzsX9DJrbqVMdzFE/GsG0AdsEntnjqaXL/ALHCS/1xkvue7SiW9Vysbh3/MSkkx1H9Twxe50n4inYX4bNcx6gf96hoVd/lzTh6ei8d+tNCvb3tKUrbe9Ur5h5bwv5d5rJUuvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tiiyjDvd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98658C43141; Thu, 25 Jan 2024 10:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706179460; bh=30KJx0Hyv2s41cGRszMYoB7mdxNuB2UrCQt/ZqfUUKs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tiiyjDvdbfKZx0exBt2/0RN//cStQCjFtnSPakaxjiqbG09QwFo18dipIHYu7nzxn RVwkrr5dktoACJi88yZZZ9/HdBEr6P3GkbdKOiUk+n5ZstTXnePmN6GpkM2K7hDVPx LH9pboX0utRBk1s/irQx+LbBWJpf5vAR4ARbUrw3AqHjbpvTEhu7xS8ossIVwbv/fu ogcFceg+N1ZNJXgWNskpnXHSSTB2X5Nw/htf4Yk9gn/ErCwg75B1ruqJyoi/RUopPR FbEjrWjNePswBEiH+qAOTDzd6cqovM4jzQVfGagjbGN7mPPG7xAvI7mpLZGaJPhazb hLdACVJxsLmOg== From: Jeff Layton Date: Thu, 25 Jan 2024 05:42:58 -0500 Subject: [PATCH v2 17/41] filelock: make locks_{insert,delete}_global_locks take file_lock_core arg Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240125-flsplit-v2-17-7485322b62c7@kernel.org> References: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> In-Reply-To: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> To: Christian Brauner , Alexander Viro , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Xiubo Li , Ilya Dryomov , Alexander Aring , David Teigland , Miklos Szeredi , Andreas Gruenbacher , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Steve French , Paulo Alcantara , Shyam Prasad N , Namjae Jeon , Sergey Senozhatsky , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Ronnie Sahlberg Cc: linux-kernel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-cifs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2261; i=jlayton@kernel.org; h=from:subject:message-id; bh=30KJx0Hyv2s41cGRszMYoB7mdxNuB2UrCQt/ZqfUUKs=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlsjs8SdqxMRoDIm0JB0F9m6FWBPyTlwlnxaXNh stmXIt6zp+JAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbI7PAAKCRAADmhBGVaC FaThD/40Eel9ws4bpv6pYZmYpdrd8jeJp98F+T2aA7ikIwzWJsKndDyk2Egd1khC7kp7criXZWY krm85yb2xHZQOmQf/65I+9iuO8dkgZX0fP/ApSqlVYuaPqEVNQfpOCv7EK7vt4XgUDBTnANna/s VAeGNE31T/jCfCNaJuyl99kSQY0TEYzBbZ1wFgODmNgtAUwkcQGh0Q+h587Ob/gLDKpGzC1Beiv hbHo1r6r3rLV3Ca/QTWQQps5FVrE6OEDI0YEp6P6paTU0rqH+LGTrECH65hSaY/SmYlR/2p5MwK mMWHnpaqxrBhhBANC8odgeQKG4T4FFtGoe1O0Sp6VB230qO8WJ1OcQAfzPb9ohfMwZyxtrEJzvO Dq8VeRwzGTjqfYe7ozmHCBLm8edr736h6MKUTPpTl3F2noKOg62yKz7sJTDhkwYnY00TOvQTRYJ DuApjYo3w6BpPZ9AEkFXTaV0GN6OCI18G0iiKUevHQRm4Ahrs8GFqBtmNj0ukxxpr3uwA0cISpY A0tNo4Bt2+aWAdVg2A5OlHrWd6PGiVmJbR3FtRi/kxP2fsHbzX76yBtPbYMrdGPOX00Ekh/UpNd Sm7ASI6azyN8L4WZus725Ekd+SPYNpoqUr4GqP6F7NNzHcDRYic/6hgKvLNo5vOGQdFamQlbYMa bdHjgLS82BZCPGA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Convert these functions to take a file_lock_core instead of a file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index effe84f954f9..ad4bb9cd4c9d 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -596,20 +596,20 @@ static int posix_same_owner(struct file_lock_core *fl1, struct file_lock_core *f } /* Must be called with the flc_lock held! */ -static void locks_insert_global_locks(struct file_lock *fl) +static void locks_insert_global_locks(struct file_lock_core *flc) { struct file_lock_list_struct *fll = this_cpu_ptr(&file_lock_list); percpu_rwsem_assert_held(&file_rwsem); spin_lock(&fll->lock); - fl->fl_core.flc_link_cpu = smp_processor_id(); - hlist_add_head(&fl->fl_core.flc_link, &fll->hlist); + flc->flc_link_cpu = smp_processor_id(); + hlist_add_head(&flc->flc_link, &fll->hlist); spin_unlock(&fll->lock); } /* Must be called with the flc_lock held! */ -static void locks_delete_global_locks(struct file_lock *fl) +static void locks_delete_global_locks(struct file_lock_core *flc) { struct file_lock_list_struct *fll; @@ -620,12 +620,12 @@ static void locks_delete_global_locks(struct file_lock *fl) * is done while holding the flc_lock, and new insertions into the list * also require that it be held. */ - if (hlist_unhashed(&fl->fl_core.flc_link)) + if (hlist_unhashed(&flc->flc_link)) return; - fll = per_cpu_ptr(&file_lock_list, fl->fl_core.flc_link_cpu); + fll = per_cpu_ptr(&file_lock_list, flc->flc_link_cpu); spin_lock(&fll->lock); - hlist_del_init(&fl->fl_core.flc_link); + hlist_del_init(&flc->flc_link); spin_unlock(&fll->lock); } @@ -814,13 +814,13 @@ static void locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) { list_add_tail(&fl->fl_core.flc_list, before); - locks_insert_global_locks(fl); + locks_insert_global_locks(&fl->fl_core); } static void locks_unlink_lock_ctx(struct file_lock *fl) { - locks_delete_global_locks(fl); + locks_delete_global_locks(&fl->fl_core); list_del_init(&fl->fl_core.flc_list); locks_wake_up_blocks(fl); } -- 2.43.0