From patchwork Wed Jan 31 23:02:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 195033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp84426dyc; Wed, 31 Jan 2024 15:16:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFII+fS8KnXEfErxfkBGfer2Vime+2U0PmIKFD4oCjOXNIuN/FDkp0c4HmrsUfSTu8uaWZx X-Received: by 2002:a05:6214:d05:b0:68c:3644:3112 with SMTP id 5-20020a0562140d0500b0068c36443112mr3574104qvh.41.1706743003976; Wed, 31 Jan 2024 15:16:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706743003; cv=pass; d=google.com; s=arc-20160816; b=yR7cKyfUxsVS7ss7f/XAtQv81sUbJJYzqur911pZMTeWOByakGWBbkJWr8VdmH+/Zx yQ6pzEZ0+j0XWs8ozuRe+ouIarrCc8oduhI+DLtrQlG7YRy4z7dKcDsWFNx31/NY+dBl v7H0guXwt4bWCYdYDyw5C/PNIWK2xbgRUzCtNVW+T12PG0jsZ9LpYskxpgcvY8ugXstd UnIHlkFeKLKYYkFPeKhlsQm7H6Djx+mM/e51eYS0PeQEEtu/7kPDYiqTB1Uz4I1ZeQRn +U61KHo8u+n72CbLhCmm2dS91g/kjpLGTYpeLK71s/SDjHuF3GSYNBBwRdxLl8/fmJES Gdrg== 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=U0xiTiCDBT1DrsuPCzbsYgb1JKG7PlldAJoKMa+Za9c=; fh=mKZNENknwQkqZeUV4dazCCi3Q4N4lW8uvEKjLIfTYzU=; b=ep6KrNcnH8wSY1ymI7cqdYrDNh1hkb0QFluQCm0I2/z/NO4JiowTsEZY7ydQ4fsok3 nBJQoLRhCNbLqtHhlObJ/ecreHR301kOQiMAs7UEUJInDux6wzM737aVwLcHzHwTOxi4 UzhFQKMNOA1af1peXVBJZKiaRYRk83zd1Xcd/5ZmM/39BBE6/lZbvcOlWDZ71Dtsl8uA dzGgIb3hfnN4N3uUW05xiX6r5iG7Tk790d5aN6738Q4jKgCJMYiSD1JqmmMoqHV0761Q Zqna3CTi5Lx+ih6XD3Boj8+11WsHZm+69yTnVi9XuCGpr0xFYfgH0holpY2tPcFYr2cG Cr0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=of+aN9Fo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47317-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47317-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU0JQI3eaJhan6yur7LSsATOhIlEHV/st1TJ8+OZ1zb/I0XHwhG/g6o4DK1wmdsOrjVrwqnf8YpIiLgv6lPMmzg/VvPcQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x13-20020a05620a258d00b00783a6e87c49si14581240qko.175.2024.01.31.15.16.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:16:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47317-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=of+aN9Fo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47317-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47317-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 90AB51C24183 for ; Wed, 31 Jan 2024 23:16:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08022145339; Wed, 31 Jan 2024 23:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="of+aN9Fo" 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 E521A145320; Wed, 31 Jan 2024 23:04:15 +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=1706742256; cv=none; b=NZb7YxXzTDOcZBHNZl/j5LfkqBx3PCL1qKsrYp2aiAw4CCGbBFfKJCUiAX+ua/D1zYss8necgtiM+vJku8dGvf7Eh728brAcKEg6aB7dNi5PBmSBF4imTZtqLBWuo3nMWS1Ru/njM9fMQR2neoH4xxShtuIf5nqqmlg1/WRDzjg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742256; c=relaxed/simple; bh=pXZ4V1pbOgczFwwAtEF+oajUDhW4eIw9Ye+Sx1hORgg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A1jQTHlNQ3sDcscGT+3+z2y5e9BdJsycdrilpWYj7FlYvr284aDuh/WSWKyKW6hVZtiNlQNM6WdMo2ThGiL4N/Ogvlym6zF7ne7UwYM2Jo6zoNKIHU/pHVLQj3lrv3u9ANRYWGlcequa0VNHRYgb/IM2iP7URSizz5azpRRoZiY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=of+aN9Fo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9E75C433F1; Wed, 31 Jan 2024 23:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742255; bh=pXZ4V1pbOgczFwwAtEF+oajUDhW4eIw9Ye+Sx1hORgg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=of+aN9Fo7MsgaT2JE9Fkn94Km+Tsd+i0Bohle9euwxnzZr/6f6Qc3cpVeRsKX2m+V 6EmO+axk0uVWnPnDheiv0pFw1k+SK81ng9rCu36uku2viemTrZA54vme1ak3J1erRr E+ZCIDNTgJMvO4Gvk2jEdGYr+hgbZWGOOc/ePQ4VP9DaY+ec9xVvh0smQqK7QEXUiC ULLlSW5NcjRO+Jq3INZWB2HUVi4tG/opA62rjlB4YO2jSOxkb+Z0odqTxucdzvPt4W 4QlhTx9irucd/dfstbbSN+C6EGp+opECgsM7Xphht871DNLC5rfrSzrnEsDB0hBrmy Lnqq8mUPcejXQ== From: Jeff Layton Date: Wed, 31 Jan 2024 18:02:11 -0500 Subject: [PATCH v3 30/47] filelock: convert locks_wake_up_blocks to take a file_lock_core pointer Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240131-flsplit-v3-30-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=2191; i=jlayton@kernel.org; h=from:subject:message-id; bh=pXZ4V1pbOgczFwwAtEF+oajUDhW4eIw9Ye+Sx1hORgg=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlutFy5SUWitkQ9qblwQyS1dppZibGWT5J31Nuo qbgZbE9hQCJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbrRcgAKCRAADmhBGVaC Fe6DD/9Vxyy8wNJrdh+IwW2cV8gOOQwzjr6maWWLKA5blIAsumiuFvzZLXJSihcFCoJ1LiVonWe BvbUow4volc/ThTa1TlBL9dPUaaJT56oXwQ4RbUi4CW/WBCiSjaJZY+0jxA0EmdBL+DH5nS3xCy smGim2TkDqn2lO6ili9fuPYX6TbWf9iyCV3PcqVXiFrfvNF8sO3hkx1By95bhoI/XnOHz8jbLkf jSv59ZiWVV12RCiinXsOmQMDgNSJeC3CEEJaKSHD5JILs7ROCotd+ZOiy9gp9aLYwKRMqLbNd0z 2ztqnOFhbNRRBipjWIPX2cwtO4t9rt1hM3W54YDMpZg4vvyEHhoVdIZYpTYEggCBi/Oi91OEwQD rFq7S/944SGLJKpNP2x3RZui3a9/3JTY9eqd6rk15C+2xCtpMKoMVhWxXgTdVESsbl3KC9Q7T8z lDUBs+zzu4MEgQqR809U+AKjy5IxD8cqz7QJjmSJu7BsdI+bgeakBS7AA73uwA2pcigvAXoMcQO prpaXqnnQYJ381/f+pR1nGea8MdyL0jJNItn3ZU7a55afBopYmX8A1Rt5aBVHepoxmbvAb7JupR rWxZ37syiAhZDHJzOY/ZHfyAJbkAzrdK+Yq0x9ididtcb6n8b03q9ThKYfa6EJ8IsTS1jXRXi8j gtt3GrDS5wJzcIg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789649752248719275 X-GMAIL-MSGID: 1789649752248719275 Have locks_wake_up_blocks take a file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 6892511ed89b..9f3670ba0880 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -806,7 +806,7 @@ static void locks_insert_block(struct file_lock_core *blocker, * * Must be called with the inode->flc_lock held! */ -static void locks_wake_up_blocks(struct file_lock *blocker) +static void locks_wake_up_blocks(struct file_lock_core *blocker) { /* * Avoid taking global lock if list is empty. This is safe since new @@ -815,11 +815,11 @@ static void locks_wake_up_blocks(struct file_lock *blocker) * fl_blocked_requests list does not require the flc_lock, so we must * recheck list_empty() after acquiring the blocked_lock_lock. */ - if (list_empty(&blocker->c.flc_blocked_requests)) + if (list_empty(&blocker->flc_blocked_requests)) return; spin_lock(&blocked_lock_lock); - __locks_wake_up_blocks(&blocker->c); + __locks_wake_up_blocks(blocker); spin_unlock(&blocked_lock_lock); } @@ -835,7 +835,7 @@ locks_unlink_lock_ctx(struct file_lock *fl) { locks_delete_global_locks(&fl->c); list_del_init(&fl->c.flc_list); - locks_wake_up_blocks(fl); + locks_wake_up_blocks(&fl->c); } static void @@ -1328,11 +1328,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, locks_insert_lock_ctx(left, &fl->c.flc_list); } right->fl_start = request->fl_end + 1; - locks_wake_up_blocks(right); + locks_wake_up_blocks(&right->c); } if (left) { left->fl_end = request->fl_start - 1; - locks_wake_up_blocks(left); + locks_wake_up_blocks(&left->c); } out: spin_unlock(&ctx->flc_lock); @@ -1414,7 +1414,7 @@ int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) if (error) return error; lease_clear_pending(fl, arg); - locks_wake_up_blocks(fl); + locks_wake_up_blocks(&fl->c); if (arg == F_UNLCK) { struct file *filp = fl->c.flc_file;