Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1968015rdb; Wed, 31 Jan 2024 15:12:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMA1okuIhNta9Z2IeWzB2ahm1VWAOq3MlwM/YGebce25SgZ7WGjP4CD9aKUMUOm0w4y8we X-Received: by 2002:a05:6902:1d0:b0:dc6:bd47:cc0d with SMTP id u16-20020a05690201d000b00dc6bd47cc0dmr3128945ybh.28.1706742733706; Wed, 31 Jan 2024 15:12:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706742733; cv=pass; d=google.com; s=arc-20160816; b=O6YVv0r1L96T968siCNtBXjFXdrhmmiDrCJ3mI7JfaZmyUqOUE+n1aD08Lzi/KDIhb A+oxLwyzLVj1fEHSZoloYfBsqR71OnIbHM8bKZEZE0jlW/ssSsF+61mA45GfZRKJVLeq tpMFzThH6xZv/c9G7g1+8EmCQlAcK39sY6kfM4fzvIDa+p4SqCIAYBt61JFIoRSsaO9S Fv/lb8giFsvUXCiFC1fgpxJFhUrU5wcSbq8mSc2fkakAeVTB5GT4czSgZbDQIgKGTWrg etvTwbK12tr/ASJbTzXlFdB9ABMT5zLwp9tIUgv6u0nTwefgPSuZcJob6ktoD+vHgi73 aeHA== 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=GtYs2WDEBXF90eME/NC8kNULtpnVf8mYauBhtbIa7sw=; fh=7NZiSAZrRYszuatpSaNV39b2cM2fzEN2iHI8EfXs2Vg=; b=L+pr0ePfcpMi1pnM2Wdwv/Jnz9946cel6fo/uJ2zYwFuHJzdg7yMpd9/KYMz3Rql1C jaFiYL4I2zNu4+WFwxJR5FQH9dOKL5Ox9wVck4Cxx+QGC54VCVofE1oryRlxzscVi9A6 dDyosBhr5o/8WgB2sX9tpru4U5fGZTJdaykA4rkBwV67d7QhOAVta1mvZOq2huuv63tI 1cgbmdfQG181N/ik97Pro2OdQRsstrT9h6mw3d3VEuYwmp2zLVdfEOzkExnMi49qp0/z WfypeiuP2MiP483PcEPLC+gLF7qXLaZaTRz2X0vTXnmIwC+kt4Fpk/TgdTiLyUn92DHK 0GGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QVNAmxi1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1659-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u25-20020a05620a085900b0078402036e70si6466980qku.724.2024.01.31.15.12.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:12:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QVNAmxi1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1659-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1659-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 755411C2387E for ; Wed, 31 Jan 2024 23:12:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 263A43C48D; Wed, 31 Jan 2024 23:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QVNAmxi1" 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 E031A13D50D; Wed, 31 Jan 2024 23:03:43 +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=1706742224; cv=none; b=qw9DXslHEmpl6NRU/pY8RvXS6GDGe04UJyfMG4KqnBwJ5gP7YYYGsHNCGrPoAxN7b9ADaw6OY3cngo13QrXBS0Sn6BtuV5WUwBBgDtN6dcCBzC0czGYHpBL/Ig1dIoDHCOi6W5t6q0HWdhgH+WA/+YNzeD4JSidmwS6RdjctpOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742224; c=relaxed/simple; bh=HcLhLyMTb0uV3nLml2p2oQReU+iiXkPoxKB/zr8tLAM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iWJyLR7OYEN/tNITLBdnVKlnL9ngZqz/jW8CbUDkl4ex/LvVErKWbUfO/AwH/F3hGqOCvG5t/M4tI3o0ZQJExUnS5aDflRPsGqPQj5MMNQB3gjg4iKUd/R+JCExucEBqoGvnfN30JF7OoAEVGp+IMwjgMW9FD5hmQBKKMayhQPM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QVNAmxi1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09278C43399; Wed, 31 Jan 2024 23:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742223; bh=HcLhLyMTb0uV3nLml2p2oQReU+iiXkPoxKB/zr8tLAM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QVNAmxi1i6F1oqR1nDjSI6sAlWfgttyGldYI9QmOV7ZUVOhcfAX+E0NoZwgYO38xX KtfUvn/IGIxoW3hxvZFrZD2G2FTAOl2qDrfTwVcD8pqDAsjEGp43mczTuNdl+xdo8o XEDYDKxWrYjrBpWlJbzU7moItH3FgFgD2Cc6SB+TUETqDwMHUZdhyM/1/Lhdd+mEgQ wdPqIsONFE4UZez3YWbh0sMx349mgaqz89KhgZEWt/Gfwl+yDUzZXLksQH3P+Bihwh DuaSL5Bq0NOIgK+x+tFXgsFKlVORXCJtkpTc3KXt7SdiYahJqjFzfvSOhH+sNfabyK 2bGNpH/Ctb+EA== From: Jeff Layton Date: Wed, 31 Jan 2024 18:02:03 -0500 Subject: [PATCH v3 22/47] 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: <20240131-flsplit-v3-22-c6129007ee8d@kernel.org> References: <20240131-flsplit-v3-0-c6129007ee8d@kernel.org> In-Reply-To: <20240131-flsplit-v3-0-c6129007ee8d@kernel.org> To: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Chuck Lever , Alexander Viro , Christian Brauner , Jan Kara , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Xiubo Li , Ilya Dryomov , Alexander Aring , David Teigland , Andreas Gruenbacher , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , Mark Fasheh , Joel Becker , Joseph Qi , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Namjae Jeon , Sergey Senozhatsky , Miklos Szeredi Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, ceph-devel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, ocfs2-devel@lists.linux.dev, linux-cifs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2207; i=jlayton@kernel.org; h=from:subject:message-id; bh=HcLhLyMTb0uV3nLml2p2oQReU+iiXkPoxKB/zr8tLAM=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlutFxeTa4E2kYEHNuBcC2Pw7Gr50YkKLnTstR6 aNLAut81X2JAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbrRcQAKCRAADmhBGVaC FTu3EACcK9RVjwnt0r8GlR/FGOGylMhxITZC9JaUrZbWc7gcMdUdvTFGYIGbIjpHAcUu+5I8vaB p9xg9e5SHmAyK7JhZxl1nQrdxMqsOiVY6Yez1QAVjYxAffljEkfqKfZwIl5FVZ9W4shbrqMsj4n vIgjFuruTFjZEYU7y5TbFIpEpWjVpCSVIsZseq+f6aPWTOhviRFbcEf+hfn+ibcreHeDROx+h90 ILa7AM6Gujz3xzVL6mzxcdov0f/diDoqC1K5ZIbycBBxFp5rVdcZrTHJpaVaWrRkdm6oAeZK+1k e+NJDUs4qR1z3UQoAEzrH0H3bUvgvBj/+gjASNo0VjkoaFAv6Ep4BUSI1HDhRx/AXdUjCRIyIXf LGlZWGZg6lPagPrA55jXzIUfgXAbepYHCTKi1B+GcopocpfbjMM1HwPbdf0bQvp9hP7RI3BC9CI 3QNneTqSJLdD8yeNHRvvKTJ8LacFEEBOQql13VHFh6eiSVxU1ewUYFR2GBr9kcj0cnrsb2MKp3q CT1jjqZPaUk6xgBsOephGU5f6qxxUcJUBgJLQEg0mKeYr1FCzPvwkq7Q+KYQBEgxatYzUru4qE1 4K60QBu/dKWJjXKk7OLfHyYcqokj3Z7qILeHSj0QNGBDs9mq5hw6TpkriHHfiyzEIkwypAPEUFP SUlsBbSEnLn0Uhw== 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 1cfd02562e9f..fa9b2beed0d7 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->c.flc_link_cpu = smp_processor_id(); - hlist_add_head(&fl->c.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->c.flc_link)) + if (hlist_unhashed(&flc->flc_link)) return; - fll = per_cpu_ptr(&file_lock_list, fl->c.flc_link_cpu); + fll = per_cpu_ptr(&file_lock_list, flc->flc_link_cpu); spin_lock(&fll->lock); - hlist_del_init(&fl->c.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->c.flc_list, before); - locks_insert_global_locks(fl); + locks_insert_global_locks(&fl->c); } static void locks_unlink_lock_ctx(struct file_lock *fl) { - locks_delete_global_locks(fl); + locks_delete_global_locks(&fl->c); list_del_init(&fl->c.flc_list); locks_wake_up_blocks(fl); } -- 2.43.0