[v3,22/47] filelock: make locks_{insert,delete}_global_locks take file_lock_core arg
Message ID | 20240131-flsplit-v3-22-c6129007ee8d@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-47308-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp82580dyc; Wed, 31 Jan 2024 15:12:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe6q1oEH8t/8WKd17R6YnrA6seBVNU7VU6MiPzuyiQHb81rBTT7pfOJzNgzzpR5nrlRAiG X-Received: by 2002:aa7:d311:0:b0:55f:891:d8e3 with SMTP id p17-20020aa7d311000000b0055f0891d8e3mr2110082edq.21.1706742756338; Wed, 31 Jan 2024 15:12:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706742756; cv=pass; d=google.com; s=arc-20160816; b=SwVeIKoEXCFGwQRHf1LnMEs7TFqRNNH7dmCA+Dn9xQDL2uqG6eEGpPwUxIA8wSh7hh ibrexvOEJDb3C+BeEP+BMaMRSyz0FfsGvshzkfkkQJqTjdytVLUGQqMzQMehEFDkJCaA sg1+jXKwD1nTGNlKKHUH85zAkQ8FQTFtApCiSTbC05+lIbKigrTGA9gX1snx4qO8OgRX r4Tst0N5RJglvC/4FEtr14ZMMRYAmTzP0WC4+0vkl4Tw0pGZhqoGPyZVXONu4g/O8VOE gmgpXGKrNB4u8dTHldaTprVIVVp+UckIrjIMsZgpa+nt2IWkdFFx5kfznYT9jEao+ngr WEEw== 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=RMOkTeLPWe+19RWlNKVN92/AKZ6ZxWnrzrjQ9sk4auI=; b=CnrMkguH67uB4jxZSYaqrKQTeQWkWptZx8cbhEV+AvyE6X0+wrwMl69ZikuBAzlK50 vUc8HFuhrAOHJeydyfRP+dLCcTlAH+KQ4uCgmT54/iElLGzNo3vcv4FkGw0LjSs1alcV pxZV4jEtKgMQM8WFB41nGRXJYga6g6X7AtELkYC5CFmcQUYKGFSlexxqvtZJTjvDEdTm Lx3U/lCD+jIT1iDXhstnDCKijfjL8NuZDveI15+1HdcLd5BCHnfM5K/UdQZOjhA9dUFj KNFmiG1eQSqzkwkJRysOS0TBo1uIT7N9H+Asob5zS+CLRdaV5Mu2FjTg964X1p8qgfdW QVqQ==; dara=google.com 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-kernel+bounces-47308-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47308-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVSCPqwpabkD0zy6nC7ASUAVTNVsrHJkDGsNqwid9SAH9cYGo/w26vvtQ3d7HGwePEoyC6RzaEaYjQlhNya1xDi0JvYtg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f28-20020a50a6dc000000b0055ef2c893besi3822206edc.326.2024.01.31.15.12.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:12:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47308-ouuuleilei=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=QVNAmxi1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47308-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47308-ouuuleilei=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 E6FF41F2C9A3 for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 23:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C8EC13DB9C; Wed, 31 Jan 2024 23:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QVNAmxi1" 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 <jlayton@kernel.org> 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-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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 <rostedt@goodmis.org>, Masami Hiramatsu <mhiramat@kernel.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Chuck Lever <chuck.lever@oracle.com>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, Eric Van Hensbergen <ericvh@kernel.org>, Latchesar Ionkov <lucho@ionkov.net>, Dominique Martinet <asmadeus@codewreck.org>, Christian Schoenebeck <linux_oss@crudebyte.com>, David Howells <dhowells@redhat.com>, Marc Dionne <marc.dionne@auristor.com>, Xiubo Li <xiubli@redhat.com>, Ilya Dryomov <idryomov@gmail.com>, Alexander Aring <aahringo@redhat.com>, David Teigland <teigland@redhat.com>, Andreas Gruenbacher <agruenba@redhat.com>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>, Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>, Joseph Qi <joseph.qi@linux.alibaba.com>, Steve French <sfrench@samba.org>, Paulo Alcantara <pc@manguebit.com>, Ronnie Sahlberg <ronniesahlberg@gmail.com>, Shyam Prasad N <sprasad@microsoft.com>, Namjae Jeon <linkinjeon@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Miklos Szeredi <miklos@szeredi.hu> 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 <jlayton@kernel.org> 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789649491996346852 X-GMAIL-MSGID: 1789649491996346852 |
Series |
filelock: split file leases out of struct file_lock
|
|
Commit Message
Jeff Layton
Jan. 31, 2024, 11:02 p.m. UTC
Convert these functions to take a file_lock_core instead of a file_lock.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
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); }