Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1674570rdb; Thu, 25 Jan 2024 02:53:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUYu+szIguOj08iLA//NBbnPvFgoMXBbPF+fypU2wpQ1bh5Ut5Q0rqnETMhnOyLCpnbZSR X-Received: by 2002:a05:622a:104e:b0:42a:6235:b039 with SMTP id f14-20020a05622a104e00b0042a6235b039mr902242qte.61.1706179999728; Thu, 25 Jan 2024 02:53:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706179999; cv=pass; d=google.com; s=arc-20160816; b=QFsKk2wLaqeHgZ2y+OlKNjmAByE59zQr/wzuXCFSqprXWYZ7Li8X1vQvOzBnDiN4ZX ypm3tkui9EvWzShPIGBMQnC+lrK+ooYNnXqceOQsyE3L0hFq1ER8ZqhTojStcSq/LBrh PpyjTfr0P9xR+TG6hupILvgZ+aDnUjKFTUIXugpj7iOdDfRWGfJWm8tHwCdmfuLLvJBi Gy7QwZ5yXGTPcLAHRpZhwrQS6b4a8up4lGjql5TF57nxI5+Hnf84bnpn8C2ynq79p4o4 8XHXHpZoB/7qsiDhOTrebnGpKg9nny60eGyZaNIVtmaB8wmwTiQ9OWPxv12hPEwe+r6S U6lg== 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=Ct74MacfO/Bos+TKq2qlRbxKw0kUSbMr7eZqY9oiTE4=; fh=AED2lrIQZhdppGHbaRrNz6/BI48B+mbutB2egpFPmJc=; b=aT15WYjR8WYSqjWiYkqdcjBR1UNNGR7zmI2+FHBUFlczHefklGt0P2crVrygJluveW U4Ni10lcvPRFks3/Q3fXljnQTEcLDDY/KG0SV40Jkp+sfsizmFScS/GnppxkmkLva0Va Mk+2jqFiJ1nNsHoFuZDZnDeYnFvYXOcEslAelcen1z4nZyP9o0fdOIJ2XTBrhvfPwzYP Wl69D62Ejb6KYp+o6kKMjKL4Ja2rb6mlRtr3R7k9KDrFz5PJSIz3JFpN0nwJo2Tn1k3g 7mYA1s07hy030yuisftwDZFqz1X+RzUs6ni8UlJrBAc6RRaXYJ67qDCr1BFDvzlRpcE4 XXCQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W4Ih6SnA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1349-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1349-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t21-20020a05622a181500b0042a0b356114si12530820qtc.313.2024.01.25.02.53.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 02:53:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1349-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W4Ih6SnA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1349-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1349-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7C23A1C2325F for ; Thu, 25 Jan 2024 10:53:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD1E960251; Thu, 25 Jan 2024 10:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W4Ih6SnA" 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 853176024A; Thu, 25 Jan 2024 10:44:16 +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=1706179456; cv=none; b=kUKYxaVPLbJdqF73ZIAXC44WiJqzwcXlgj2gGByRClXzrSGMl5D8MmCtd9kQKDomfgdCdeqqS7QElNM0zDX1Cehu+uODcUyNbT73f4IFDDDBSMHy9L8rVZmZ/55bW3Fwe6UIMtkXeZX2OcpY/xkpzxy1P0Orgu5KzP0gwiuVh40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179456; c=relaxed/simple; bh=xSVfPHaguydEBPpPQLuNdFuo/APap+U5zYROxyDf4gM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gx0k9yW6XZgvJQTYzBzALDyaYGzC8L0pRtwGVKsoOsKn4sORkYB5lAhxds0Fh/TUHjm/Qcx9PiWUu6bH/326WGGyVY+eEQyEnpy+YRG3+C++o79SGlgrIPKuFpOZ7al9j3ftmDNYOo+Q1/mXgRNSToWGohXR/LdsYANmT0mDNo0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W4Ih6SnA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C30A9C433C7; Thu, 25 Jan 2024 10:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706179456; bh=xSVfPHaguydEBPpPQLuNdFuo/APap+U5zYROxyDf4gM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=W4Ih6SnAyrmlL/pbQq+dSbWolzHvXP3cFj8zyzzuSPNDYq2GQJrkhnBV+NaTUBZQH h3Wf/hISbHwISlUm6TOkbEraC0blxZ/7s+aBeUQOVA6jU+YPFh2GnrG1LPhpnjdG7p yh0Vd9sOUVwLo0MWI+pST/9C9USADJdsr7jH7sqNHKZY34XOHqUr0rjuBVrxnbenx5 Vaa0oDCjelWWsesqrn4Rb5OUNcp+4eLwwqviC6KRTZ2OeX3DfaCmM0WgIZEyGjLdgz amHUq7miwssXF9D+VUL4OkUG5A10nJHIKQ9k7tcHreHKYNIiNBTEljhsxWp8O8NaZC JwcFGmjc2HDQg== From: Jeff Layton Date: Thu, 25 Jan 2024 05:42:57 -0500 Subject: [PATCH v2 16/41] filelock: convert posix_owner_key to 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-16-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=1528; i=jlayton@kernel.org; h=from:subject:message-id; bh=xSVfPHaguydEBPpPQLuNdFuo/APap+U5zYROxyDf4gM=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlsjs7kqDnVp6EIWs+kAfd7OL//ENkspIJLKDt3 pgw/e/sksmJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbI7OwAKCRAADmhBGVaC Fa02D/sGkJvM0+1Gyqi9Ahb0gvaTr36ipvatPN8+hUBWAXsoQZcjQxmC+JnWo1I3LWtN2+B4F+x cXSFkYnNbCoo1IcNGi0rNpF6t5pfIfvjWI8K9b5PBgCErLUxwx+eiASCliblkPDkyDzn09w/aOZ 3Mm5YH9A2OdKFlhcxg2qebsKYrRuXJ+kQJCOQIcXI4S3/RppUctxnP5UHwzHlQU2WgjbYZgq+7F nwanSumVKmXsQ6oYIji10GDmY7drFXM9OXjobNwbfp6qSQ42ggNa4UweNy5ilTI35ZxVbVU20T/ FOnbo10FdAxehOnK0/a4kC6fiKmCgCSn2HZm/skxGegjdhwsxT6DicpgJrvJ/gY137A85PM+Ksh 050Jo4sJMagHZRiafNZMutlGOH3jZkKsk5PulPWRewnf6H6r4YGZnLeIg+we1p0BQDy3kCH+LSG s22oa43pKd5WCV09AIpxFL87sd42SNpzozrYFIDKEOriNV/cIJBMfG/45nkZ6na9Qux8X6z1Bk7 G6jqL29FH1VleuICm4oSXzwmCHocFRp9dRqWueFSH6vdjI6mKablX7fvqsgGOr7mUnFXurQG/67 +F7ZMaCW6ELNY62DhjV2KGTLueHj2gIfs7Fkr6DIWI+Lk3rGp2Sh18MKL9ecZwSPQ5hYLrF9IqU Z5m2GRlSph+9ejg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Convert posix_owner_key to take struct file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index bd0cfee230ae..effe84f954f9 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -630,9 +630,9 @@ static void locks_delete_global_locks(struct file_lock *fl) } static unsigned long -posix_owner_key(struct file_lock *fl) +posix_owner_key(struct file_lock_core *flc) { - return (unsigned long) fl->fl_core.flc_owner; + return (unsigned long) flc->flc_owner; } static void locks_insert_global_blocked(struct file_lock *waiter) @@ -640,7 +640,7 @@ static void locks_insert_global_blocked(struct file_lock *waiter) lockdep_assert_held(&blocked_lock_lock); hash_add(blocked_hash, &waiter->fl_core.flc_link, - posix_owner_key(waiter)); + posix_owner_key(&waiter->fl_core)); } static void locks_delete_global_blocked(struct file_lock *waiter) @@ -977,7 +977,7 @@ static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl) { struct file_lock *fl; - hash_for_each_possible(blocked_hash, fl, fl_core.flc_link, posix_owner_key(block_fl)) { + hash_for_each_possible(blocked_hash, fl, fl_core.flc_link, posix_owner_key(&block_fl->fl_core)) { if (posix_same_owner(&fl->fl_core, &block_fl->fl_core)) { while (fl->fl_core.flc_blocker) fl = fl->fl_core.flc_blocker; -- 2.43.0