Message ID | 20240125-flsplit-v2-22-7485322b62c7@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-38435-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp1554652dyi; Thu, 25 Jan 2024 02:56:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnhX2mKjKQaPC3gBHjb2+phHdg/6xxjEGWZkeLPY34zNREUXqi43TUax+0sreeVV4wsfUu X-Received: by 2002:a05:622a:316:b0:42a:333e:fd8a with SMTP id q22-20020a05622a031600b0042a333efd8amr1049834qtw.105.1706180206935; Thu, 25 Jan 2024 02:56:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706180206; cv=pass; d=google.com; s=arc-20160816; b=TKBHLvHfqoxtL/j1bTUzBPe/1rN69TNai3+QnBpNwdhI8QdKwuc5zjvy4NHqMSl62s pwaMcff3upZ1n8WsRRaiCitpn+mWzJDJiio9zk/CmoaCt6W0sLmE3OVdQ4Ko6lghiLHR RW51F/F3CdBzeJISVNQxK/jR0TuqVjeuhnXSj4aoDp9KoKmr9cqWH4bJUIc1uVZPlogx ZQ07ccT7Rdf0GnIaczmwFOiocEc9lHSO+7rC6nDam9gPReqiYaLv8w5Rr4DkN2uV4S4Z /N8AcZcFY3C4j4v4v5xRvUwgNmxLUnHDTk7yFc4QaKgjD34dgJiBM50q/v1LUAoV05AV Nf8Q== 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=YvUsxcNJnteD/QPZdt3ctNhAi+6TpknD5gKogLLTjpM=; fh=AED2lrIQZhdppGHbaRrNz6/BI48B+mbutB2egpFPmJc=; b=U/CUgVEgo//HtK++K9izZpMG2W8sFrTbWWuYCMrzOreitkEn33qh1mCBj2SqWIGvFa IcAs+GWvS/nG3doyfgq0flqkiVQf4yDtdpFnCVwzXHoeyc3f1OM9EQ2MAz8Ow5pFtq92 JFbBqo6IiWhSXxEMYG3UZ9hFb+ykA9cqUhPqsF9rW6qGzYQFM73x5uUVDlwt8Ea62PKC 1OFyn7VjNoMtHH7pfBh2JpG1dhHbZmUNZ/ceEqSziYde5zfpKKUgLRAPRWscIHlf6b1C 8O7sE06HgOQ3pM4DA6oyHt2Ti+E7vQVrRiad9aG6LYbVZQvdxwfWkAEGc//tNckBszBe VZMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e90pN0CC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o13-20020ac87c4d000000b0042a3c36f800si9471838qtv.457.2024.01.25.02.56.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 02:56:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38435-ouuuleilei=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=e90pN0CC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38435-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 99AEF1C22D9B for <ouuuleilei@gmail.com>; Thu, 25 Jan 2024 10:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88F1961686; Thu, 25 Jan 2024 10:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e90pN0CC" 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 8809060EE4; Thu, 25 Jan 2024 10:44:39 +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=1706179479; cv=none; b=Q+4cFnU15Ueo5Q8hFrdk0XB8JtYjI69Chr6ldFicnMn/dPv0hYOER/a4v98MOZw5LCK5VhqalVsx0nyNot13eTtN0/e6lbDVDXzRKAn7SXtzHrh9cJgiLeDQKbHQG83w17SIDI1MRATOJubeLK+SuSies9C2QTHrNySyfLsyAI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179479; c=relaxed/simple; bh=qjAY+Yc9t3KdmxLT7uCiNgjt2jj+CbSOO+1wisiSIS4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ppGHXJH7u6Hw+fRk+a1u4/Ty3qnATRwl3cKONLnZcU3VEWDc1uaAafBCgdx+jFPRu24cWIwJLTZ0TPq4uEw1eAz4M7rRsXI+lVVY/JfMxLborCrgGjrRivT3pqH8rNlG6eex3yxsX1f1d6iEe3F2zE6yYS28v5Qwz6WPoo0fX10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e90pN0CC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0FF3C43390; Thu, 25 Jan 2024 10:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706179479; bh=qjAY+Yc9t3KdmxLT7uCiNgjt2jj+CbSOO+1wisiSIS4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=e90pN0CC4IliJTH8hSXxNKTr1haQzkPddgP/rDUr3TCsEP0H27psQ8vSGvx2ikmlK Eh8RdKHSBDxezQvvV8BGXbCvmllginf05KyS2KexZQfKOYgMyhhtgx/Hyd+qa5Sq05 P+8mB+deuYCrNN/d5z4sNwMiL8ZHBRfNDwMsKIOh/1H/kqpX8TM7iVHdwRNIlD+OgG 5k6afRT/Ib7kGmqYp3I+GFtRDuIHF9xCCmfNbORnKN49rlKTUdY7gWn/6exrHUyohg 8DubepdX+BBl/Ff48gGsedki11MuERvUmD6FWL6YuumXl6/p930RpFwnjxbbefgeKd PUPb1v87kumUA== From: Jeff Layton <jlayton@kernel.org> Date: Thu, 25 Jan 2024 05:43:03 -0500 Subject: [PATCH v2 22/41] filelock: clean up locks_delete_block internals 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: <20240125-flsplit-v2-22-7485322b62c7@kernel.org> References: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> In-Reply-To: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> To: Christian Brauner <brauner@kernel.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 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>, Miklos Szeredi <miklos@szeredi.hu>, Andreas Gruenbacher <agruenba@redhat.com>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>, Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>, Jan Kara <jack@suse.cz>, 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>, Shyam Prasad N <sprasad@microsoft.com>, Namjae Jeon <linkinjeon@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu <mhiramat@kernel.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Ronnie Sahlberg <ronniesahlberg@gmail.com> 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 <jlayton@kernel.org> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1890; i=jlayton@kernel.org; h=from:subject:message-id; bh=qjAY+Yc9t3KdmxLT7uCiNgjt2jj+CbSOO+1wisiSIS4=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlsjs8FH6gMpwQdYKuh8876nJJ1THPHZ05tbz5o tfLDTtS/CmJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbI7PAAKCRAADmhBGVaC FVrsEACf8eiJu8e08kxG39lXtQ9EakrO9CgjzZ9eYSy4JDzN2Qgd2oqyErKMqn7W7a38VZg9uMA g1TS6iwH5qK0My8cBGUcA1plbeytu66VkqeIA/axkQZrldkHeNTUwQuFac6vIByH9Wwo7mTf4hu wRsJTXtoyj6YU8IUjpoma6qXn0ehGIn4Km6HLTCFeHEp1bkjk+iFPDTSHwKS6MjlgQMc9K/ldKa nRCGieXTsyaxCcpX1ZkVHvXNJiPU/+2A+8pLWjd3LkUBIdiYhoij01/TIHaKW0dZpjmFj013iPA BAfl2DjfBV4QzhmNWdXOkLa1XY2A9NQc1YzSVKsR5UGBgCXsF+N/ZJjkaAdQ9Qirnt6mIYTq8W0 ktNWdJy4/ITz4FbW65C1mUWXmg/eXjJcbDa4+BQ0/XbL/Yc1yMQyMyKnfgCDu/jj2CjFP8k2hti pdZl6eadMjXkw/SiNz+Ro2t/TRVRLVk1B/x7a2W5e7VWt0n3WkLd/nPXSOeqbkKPVOCLLbDJY3b t12MPh34CeLy0eF+WpBXoFhK9/1HBhrh/xbLWDEaeCDnIwu7bI48GQTS/9WY//18HYIl91xGzIe ufyQCWpH3gfKQIb8fLQD7LTASISerAOFOEAgWkiyrO0eTN+e0kYm2UYP2/l7WHDw78KJ/FmHJ9S +Vq3/Fh7XpN0LRg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789059616692977866 X-GMAIL-MSGID: 1789059616692977866 |
Series |
filelock: split struct file_lock into file_lock and file_lease structs
|
|
Commit Message
Jeff Layton
Jan. 25, 2024, 10:43 a.m. UTC
Rework the internals of locks_delete_block to use struct file_lock_core
(mostly just for clarity's sake). The prototype is not changed.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/locks.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/locks.c b/fs/locks.c index 8e320c95c416..739af36d98df 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -697,9 +697,10 @@ static void __locks_wake_up_blocks(struct file_lock_core *blocker) * * lockd/nfsd need to disconnect the lock while working on it. */ -int locks_delete_block(struct file_lock *waiter) +int locks_delete_block(struct file_lock *waiter_fl) { int status = -ENOENT; + struct file_lock_core *waiter = &waiter_fl->fl_core; /* * If fl_blocker is NULL, it won't be set again as this thread "owns" @@ -722,21 +723,21 @@ int locks_delete_block(struct file_lock *waiter) * no new locks can be inserted into its fl_blocked_requests list, and * can avoid doing anything further if the list is empty. */ - if (!smp_load_acquire(&waiter->fl_core.flc_blocker) && - list_empty(&waiter->fl_core.flc_blocked_requests)) + if (!smp_load_acquire(&waiter->flc_blocker) && + list_empty(&waiter->flc_blocked_requests)) return status; spin_lock(&blocked_lock_lock); - if (waiter->fl_core.flc_blocker) + if (waiter->flc_blocker) status = 0; - __locks_wake_up_blocks(&waiter->fl_core); - __locks_delete_block(&waiter->fl_core); + __locks_wake_up_blocks(waiter); + __locks_delete_block(waiter); /* * The setting of fl_blocker to NULL marks the "done" point in deleting * a block. Paired with acquire at the top of this function. */ - smp_store_release(&waiter->fl_core.flc_blocker, NULL); + smp_store_release(&waiter->flc_blocker, NULL); spin_unlock(&blocked_lock_lock); return status; }