Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1984848rdb; Wed, 31 Jan 2024 15:52:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8tRxMBttAzUxRe4jPgxaaro+b3CntjAgflKh/MFbwilPu7aC/OQphvU3ixrUvL2oGjhlb X-Received: by 2002:a17:90a:a413:b0:290:7443:a6b7 with SMTP id y19-20020a17090aa41300b002907443a6b7mr2917656pjp.3.1706745127393; Wed, 31 Jan 2024 15:52:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706745127; cv=pass; d=google.com; s=arc-20160816; b=ddqKzz1AwNM0JwJEQ/N0/clbWMptXJPfy5uWr8ZzbfHJ1PnggX3z+2YTOzkBJwa3pR epjb1Wczk4IS07SRImuZUOQQKmMu6PaQnedVxNUEMoVtQQ80xBiWVsKVhrxp1/3fxr0L IEcPFqKFzMPTKaHM3Oe4TqDN3A9fieO8IsmZHB4rRTrepTSqvAoZrqYdHZZPXxLtx/LK OFsFJLbknZWvcVEdPJMnNzvSGSg5RCsb/QAAjsU6jMXCwWvJQ69bwV9OArt07Y5eGJSX X/43MIETJKec33FZi5+2H+85dt2juqvf6dG1fM/J31+wJcvG9gqrAXuK9aJiQWDn0xvD ZUHw== 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=WHo9+3CimyAn6ulklRe7n7slsMwQw1I7d77LOyOXXjI=; fh=7NZiSAZrRYszuatpSaNV39b2cM2fzEN2iHI8EfXs2Vg=; b=iKDC3mqRFxiiZmrIktmfijSgusPWwWjcM8RfjDI67ybfNhD5VTjj86FIgOZeLmPZsO ixHfFN+PSkyo6SfbzHy83XfQMMOyptTJ+YjmFgLS2DKsjYcC6B9T+niyBTqweMXAKHIK gdo4PVeRs6RwrdpPpIx75+vPwL3wydLP10/h2GI7e0khxhv/FvF5dAYuwEfbx4uBmbXJ +yg9qLbIdIG2wWgqiZIkoFpT+46Lt7s1da2GW33+3J8Zn7XyOe7ii6WIKsXaj3mIGgH9 yEmJZxaExTFf7TwcotmNM9CN78f48UzVWTq6DXyyBuw51ikOU05XCuHTHLw4dppjDT/o p/sg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAOAOSU7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1660-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1660-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x8-20020a17090a9dc800b00295bdae8aacsi2314972pjv.132.2024.01.31.15.52.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:52:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1660-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qAOAOSU7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1660-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1660-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6D707B2EE3F for ; Wed, 31 Jan 2024 23:12:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A63913DBA6; Wed, 31 Jan 2024 23:03:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qAOAOSU7" 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 3CFD913DBA3; Wed, 31 Jan 2024 23:03:47 +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=1706742228; cv=none; b=V7dGNI5iG2URUZO30mj3GHCzpiPOuX2xytJpBLXGBiZcn4ixAd0qPOp0wKLdkA/5uDSf7rv5uS1zJvRaPs7aLxXNqDsjK4+Ixyxo9uA6I3INs0EQ/DUEcnzNG0KdZ89rQycLXdEerRyb7GdPqnhCMSS6xO1Tws5GTj4Dd/R/Vto= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742228; c=relaxed/simple; bh=4tOxyT/oI/1lhQqF55YACz3kQzpHB6F0e4ImXu1UTTE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hRSX0Ax9vD+KzQjxAwFoRK2JRvQnI0/IuCy+qrGS67Zf2M1w87Cp7UlM/x6YKYAGSm9ipZsiezycl0GmcQv4QpQx7Wdd8ko7b+Wx89r0CWYn1MRAMqwgV78lWEUtdnUFG+J+YuK1ZE48tFv6eF1x/N5ZDD0PLjKuBQiE91Xkyfc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qAOAOSU7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0132EC433A6; Wed, 31 Jan 2024 23:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742227; bh=4tOxyT/oI/1lhQqF55YACz3kQzpHB6F0e4ImXu1UTTE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qAOAOSU72/AyfKkvF82DBj4l6z2FUZhEzDLspP4Zza4VobRC08tCPqbPqgXcRk/bQ agKiM+HnRmXCpomdoak4LOK+MAUb98NeBAYWhcHK3NagKwbFW6l83FoU6lVt7fym73 Q1aWIAG0qdLLdDS4qKhCw0MGSmYZSe3SPcZlA8mX6XYJoK58j5k0xOuFmgMMIb3Ctx i2qeohjbl29DxnwMFvViRC6b1ldMix8DPg4EtQr71JFXkl3r3SZyiWNiIHr9O+VNTV Y95pnJ3sPb0xJbw22iSPNb8bxuTGEOVgEBK8I/uZcX3AqAgsP1DF5YdqDI+BR0ynT/ /cXGkyb8wH3kg== From: Jeff Layton Date: Wed, 31 Jan 2024 18:02:04 -0500 Subject: [PATCH v3 23/47] filelock: convert locks_{insert,delete}_global_blocked 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-23-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=1916; i=jlayton@kernel.org; h=from:subject:message-id; bh=4tOxyT/oI/1lhQqF55YACz3kQzpHB6F0e4ImXu1UTTE=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlutFxwdWZ98doXE/30aQXIB5Fy9rJC1xuYMBJr LGavtYdxSKJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbrRcQAKCRAADmhBGVaC FbD1EACyRTlXeLr4ITR55lqhiH1Lzhy+kEtVEr7rjKSgz5Nudf7AbcCeSzVzjocTz/XqBa6r/7x 4UMD3pw0kazDCz/3PZSS5kWmXumuAk52BCoiQEGUD53wpGezyQP2kWrBA/uG7j4KaLVV+1b/LiM Swt52WxlfhZruRF1xuh/hhDvTvUdGpKvp8XZuSn9ImtHwhwebwZip4sNw1mZhM9wsujde+7aO0t C6WC9Ioxuy3cqt/0UaN9JogWGYpBPERfyxeyJmlScyAV7WxwWL9tYadE4RRZhUkIcuqWT1oHrZG qQ45NPsxlApwwmRRtK0Btw4hIYb5XcNKQkMvDGS65mWAGFvvEHMYbjvrh6YZ/5yT1csUBcVNMCZ vqAmLMEAj3+0AYqnNC/SLv4r4bVjss9bCbjp5P+kmqodPSQWQlBb73BahiHG9+wEdED1drjhf+0 vkgH+sC5BXJ5QQovo/tMF3gKVHwDd6dkT8KPSTupgqX+toXjH9rK8clcJug4EyiSeeZvVWqYhhC pbT9DowBVsq9IXXFbhqae8nm8tWHL7yF3l+L9DP49rP35zKjfTUsHxdqZeqXBRpzOFwqnl59GvV XMZ2FnDnaFIaodzxCpAcTo8EyxcEuO2yZvNUe49uND7eP+KC7Bp/5aMRsgkNVBEqL0r8ybHeuxw aRVlkpicLoRvccQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Have locks_insert_global_blocked and locks_delete_global_blocked take a struct file_lock_core pointer. Signed-off-by: Jeff Layton --- fs/locks.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index fa9b2beed0d7..ef67a5a7bae8 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -635,19 +635,18 @@ posix_owner_key(struct file_lock_core *flc) return (unsigned long) flc->flc_owner; } -static void locks_insert_global_blocked(struct file_lock *waiter) +static void locks_insert_global_blocked(struct file_lock_core *waiter) { lockdep_assert_held(&blocked_lock_lock); - hash_add(blocked_hash, &waiter->c.flc_link, - posix_owner_key(&waiter->c)); + hash_add(blocked_hash, &waiter->flc_link, posix_owner_key(waiter)); } -static void locks_delete_global_blocked(struct file_lock *waiter) +static void locks_delete_global_blocked(struct file_lock_core *waiter) { lockdep_assert_held(&blocked_lock_lock); - hash_del(&waiter->c.flc_link); + hash_del(&waiter->flc_link); } /* Remove waiter from blocker's block list. @@ -657,7 +656,7 @@ static void locks_delete_global_blocked(struct file_lock *waiter) */ static void __locks_delete_block(struct file_lock *waiter) { - locks_delete_global_blocked(waiter); + locks_delete_global_blocked(&waiter->c); list_del_init(&waiter->c.flc_blocked_member); } @@ -768,7 +767,7 @@ static void __locks_insert_block(struct file_lock *blocker, list_add_tail(&waiter->c.flc_blocked_member, &blocker->c.flc_blocked_requests); if ((blocker->c.flc_flags & (FL_POSIX|FL_OFDLCK)) == FL_POSIX) - locks_insert_global_blocked(waiter); + locks_insert_global_blocked(&waiter->c); /* The requests in waiter->fl_blocked are known to conflict with * waiter, but might not conflict with blocker, or the requests -- 2.43.0