Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1674134rdb; Thu, 25 Jan 2024 02:52:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH15kWSAkstxxD3HuGBPEDhfavqM2a15MLpUDeDskN98TMjbbTazaZDR3dhrOtRTzWOFW6+ X-Received: by 2002:a17:90b:3606:b0:290:21d7:aecb with SMTP id ml6-20020a17090b360600b0029021d7aecbmr1096243pjb.35.1706179934598; Thu, 25 Jan 2024 02:52:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706179934; cv=pass; d=google.com; s=arc-20160816; b=GNiDAypvB5Pn9ruWHP9hqPz2pYm53XIr8aJlgFkVsMp903jbPZqXZOSSrH/sMXr1Nj Wk8jY0iwQRbvrN7jsfzJ2sE5aIGWbViLIz2Gmxtn+ChThQE0iVKCzE+E5zLvzkvw73xZ pq4hlX11TxwWt/gd4eLOPt1HUfKvclJbMnDs3l0BQ19d/ljPMWFMGgW4cd8QLX22fZYB bNoCNlzqaF/YqjK8fW/+V/bnRvjzL3czEY+AucD+D25S2b1pIpbTlSOJf32kf+4BtXlw +YGBLvyolT6J98hNtG/HOY5cmnZsBwKIHbRASO/Hver/xUOFcL9L7R7zop+K77aBFPyF A+VQ== 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=Ssq3GQSnI0v8T41hI4S7Fm3qEabu5JOV+CUdyntUAOQ=; fh=AED2lrIQZhdppGHbaRrNz6/BI48B+mbutB2egpFPmJc=; b=QM69tqpB4jkL8Z6Tcix9JD1fx8MobYa1t13Bm2uu8EY1Kglyb7D6CrFLnmMe60ZSLN P3r03tBdxK9DSxxmHM/TqUzrSw7LcAmtu1hpVf4q71TLjsRu83ccnEaS5mMeOZ3wpzEz ryj4eMCzEEY71G5kYry5VGyR95HaXKnqDAWSzAVMCGS2DugJGCsEVqSJvNZETJvOZji2 /pQjVmDkPXAy35O4d0x+aykMIc7W2YRE3Unoq/fpa7WGn5F7jHAVnCwEhwYLEFTFmi3e /isl/ex//9U57UwosowjXiYM7DM5wg9lVpQ3/Zcp+gCQqVEzCW6sfjfO1qpdNhej/JHx zQtw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qMxlmMVl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1346-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q35-20020a635c23000000b005cfa56b4384si12278197pgb.166.2024.01.25.02.52.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 02:52:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1346-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qMxlmMVl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1346-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1346-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D90D529341E for ; Thu, 25 Jan 2024 10:51:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8912B5B5B1; Thu, 25 Jan 2024 10:44:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qMxlmMVl" 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 503455A7B9; Thu, 25 Jan 2024 10:44:05 +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=1706179445; cv=none; b=Y3U2DrBq0nTeQM7+2xupGRq6gEJ7J1+bb5FGdVn0T/aaHk2wWrUzUMKCsU4cOb+NMO0q310sdJ0hKSDEVylcW3k7BNjlD5nlJLnAp5WjBnuqZoregtfQ9LO0RPVWArnN+mAMnjg+9Xr1EFuKmJiu4Yji40U/bPfWNwVDyahI2VI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179445; c=relaxed/simple; bh=d1wKW+uOYNY5LucFFfJnlWA/GEA3kZuTsZ+64BbFtXA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ouap9TiCXJ5O14aoHIn0A8YXhiMwzGWysUHOiua9Wtaj974G7QHImtAnvfiGqyOHglzYvJptTMWItkMJRO6Yvv1yOC8o10oYMxD6rs5dwoyHvkVs7E7exGh6lZWKx6hdiQqKY68mPovFAZqGTFioyYizNFYAvz//Beib199Nurg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qMxlmMVl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AC45C43601; Thu, 25 Jan 2024 10:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706179444; bh=d1wKW+uOYNY5LucFFfJnlWA/GEA3kZuTsZ+64BbFtXA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qMxlmMVlr+sx0G+5jYEGTmCMCmLXbpAmumPdwe1FuJxm/RZQvGSUyEHnA7z88O4Xp 5z4+lHtZlnhWAEGCMdGko2TBEYQM9rEZymHTyrMEDHAcq1tSiAXaY4EaoBCXB2/x16 iDWqU2v7/ZpZKT/AyPbzDgS9OPLmYfkd9eByTHHCjFd8CYhGZbCaYGuxP1Kb6FmUz8 gMpsGCBBuijPmxxYKGk7y6olSSkU2lPDffilNVS7kexKoleGoX/g8S+uXy98Cl+R01 qjUdwjaFKhKkUc3CQqK15x+/C3KSAWezBEjGVeFyOG0s+aSIUw53NUdhHFfAsevka7 SWXxFvTAmx6MQ== From: Jeff Layton Date: Thu, 25 Jan 2024 05:42:54 -0500 Subject: [PATCH v2 13/41] filelock: convert some internal functions to use file_lock_core instead 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-13-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=1665; i=jlayton@kernel.org; h=from:subject:message-id; bh=d1wKW+uOYNY5LucFFfJnlWA/GEA3kZuTsZ+64BbFtXA=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlsjs7ijG032NvpXqx5U1Ss+bt2Ge4+GPeuITEP GeF6qbAiWuJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbI7OwAKCRAADmhBGVaC FSNOD/9qXTZbLpJya3G4IjPbYhlbEysVgVafUDB2353dfD1z/X2Am6wgPdxzKN6vPuQjOuhEO7e 9zBKt2po3GMQp8xGjYAZuAE7JeE+3LRVdrQ8IBaLRYNsgKLTh3O6RmYUzp8At22UiX4jCYrofh7 32mknwkIE2i2wZTP5hOqCtvReTxTJkzgIHtNrJO0lk3YOhDHSw0Gasf6P5EJ+eAbc0mDUWFHd48 pyA/ISCTjDN//TfFU8IAvqFBbKWfXGlNiofzwkTcGrQ0Y6Vnf1qonC67f55p4dyXX7M12FPoHMF V4rKAMARCiADhnaWch3EjsWDRAe8/bWGBWnjMFJYxX1qdJD3o3Ep01sUkgReT0MD6pJ4IJGUSj+ 2xpwZ6NTeT1PYiTH+mXFBfoYm1XesOLG09Bq1mUCQkE2rMr2+1OZMpYKGSK7j2nemyzX6yZCAXR 9c+pZlXL3bOsWvY/vb3N2Vcxorq3M5yl2Mc+458mEeHINSbuBgMz8UwMjRoaQMG29VTp2LJo5va 98ygDCtu9lZkVkNdvukbq4NeUAt1miFsHLqULiIojpWi1ww4b7ApwNV3I18CR0ZrDDMUQCtcLjt Lyal54J+bY0tfXb14q16bqkPcw++chZUiz966wHAKhD2+UiwnPCDc7up9Q7lYCCEJscvJd2OmhO d9pzWkXc2eE4f+Q== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Convert some internal fs/locks.c function to take and deal with struct file_lock_core instead of struct file_lock: - locks_init_lock_heads - locks_alloc_lock - locks_init_lock Signed-off-by: Jeff Layton --- fs/locks.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index b06fa4dea298..3a91515dbccd 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -251,13 +251,13 @@ locks_free_lock_context(struct inode *inode) } } -static void locks_init_lock_heads(struct file_lock *fl) +static void locks_init_lock_heads(struct file_lock_core *flc) { - INIT_HLIST_NODE(&fl->fl_core.flc_link); - INIT_LIST_HEAD(&fl->fl_core.flc_list); - INIT_LIST_HEAD(&fl->fl_core.flc_blocked_requests); - INIT_LIST_HEAD(&fl->fl_core.flc_blocked_member); - init_waitqueue_head(&fl->fl_core.flc_wait); + INIT_HLIST_NODE(&flc->flc_link); + INIT_LIST_HEAD(&flc->flc_list); + INIT_LIST_HEAD(&flc->flc_blocked_requests); + INIT_LIST_HEAD(&flc->flc_blocked_member); + init_waitqueue_head(&flc->flc_wait); } /* Allocate an empty lock structure. */ @@ -266,7 +266,7 @@ struct file_lock *locks_alloc_lock(void) struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL); if (fl) - locks_init_lock_heads(fl); + locks_init_lock_heads(&fl->fl_core); return fl; } @@ -347,7 +347,7 @@ locks_dispose_list(struct list_head *dispose) void locks_init_lock(struct file_lock *fl) { memset(fl, 0, sizeof(struct file_lock)); - locks_init_lock_heads(fl); + locks_init_lock_heads(&fl->fl_core); } EXPORT_SYMBOL(locks_init_lock); -- 2.43.0