Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1969922rdb; Wed, 31 Jan 2024 15:16:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3E/1R9ZaSPPnTB6uS5OtZLshbLc0YPk+ykyj4gOPOJGH3SIl2YkgYsmqaQbFNJWI4RQNS X-Received: by 2002:a05:622a:1cb:b0:42b:ee98:c1e1 with SMTP id t11-20020a05622a01cb00b0042bee98c1e1mr2484463qtw.18.1706742983136; Wed, 31 Jan 2024 15:16:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706742983; cv=pass; d=google.com; s=arc-20160816; b=ntlFRSg/dVbFue+3ocNfQMSXf6FKnIqg4dc3AawAsWxo4nmn1Yv7VqtlU0MzABmf+w egSYYGN08kvEAaDzTur/ukov9EkKy1N+hA56/P+t1LobyIuy7QUE0AszwC0bQ4MF/roJ FjOGj6Y637SIyF1BjgSCJL6KLDA8wuF0+CS8xwZHSHwse30vubhGVXvJ42D05khk7wTJ 8p4cu7lIK+WtwxSukueH16wI/Mf8vagfXC4jBw9wtacww4yIqew18Wn2pF3VynJGIYip C606Pg/61S1jVf4rf2nCjudCUK0aZn/CD0iiCb7Lv/WYfvYicsEHB3kb+JP1YKt1ZpUf zGCg== 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=fzpUNrRSCzRQHffpMufJErR8UL8Vk8JNYbgOUANH7Wc=; fh=7NZiSAZrRYszuatpSaNV39b2cM2fzEN2iHI8EfXs2Vg=; b=VRpFzUgBft0W/ydDqSaL1pOnkZqhtSgCr/TKx5sCZ7BZjouxwBWi28I45xXlgYKrtH GBPSUnwpuDtocONIkdp451L4fbSBMQgYdZcMgKCjTUGE7aeMttCQFpkRLzqhquwND5jW jkH0vhfZUOzfi5Y/gD93HmH1tujCEk/8lqR/8DduqysuGtD6yzgqEgTkPsfcZfAOZWtU MpoAb8jaRgZ9rJhRbmfoDZ0L8nA/XYXbfCaeH1zFyBKRTb0dNZncka9j8E27IpDV3+gU MfVZCOSLv5xZnJsVVncCv3D5Ka1hZKMklIsAAYxEx1XqLk1txPDpi31dF3qWUxFYpfNc MirQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bo39O7QM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1666-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. [147.75.199.223]) by mx.google.com with ESMTPS id b7-20020a05620a04e700b00783f7be929esi8486690qkh.96.2024.01.31.15.16.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:16:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1666-linux.lists.archive=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=bo39O7QM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1666-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1666-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 8C43F1C22318 for ; Wed, 31 Jan 2024 23:15:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2674144605; Wed, 31 Jan 2024 23:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bo39O7QM" 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 A80041420DD; Wed, 31 Jan 2024 23:04:11 +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=1706742251; cv=none; b=gHFhEhTKe3ZksAZXSoMNHdOU0wYzySLt13unr34xFmo41YZhqlcR919RJRSU0e2L9rDmXk7cIpylRcxmg8KmW1a2BrcJjfF2Aw+fo+2CrXrEe0U4aJq4fJnk9eigbeRdT4O5FisVOnQyeeNjLxwyd/XCyP7kBHLBDnOppDzNi68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742251; c=relaxed/simple; bh=FAQxHdV1+8yfMKT7VO4N3syoGgU+YBY/HWjJUz0wdUA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XO9T0xTN/6Kzc2PHR1wc63Z5dOpdjWgC/ObebVellMnCef9k+LFVfZSiWU1ZdDMkkQV+WWX+BVFB+BcYAy3RL50i9zShH66Gb92myl24SOIZnxi3ZuxTR2AJP+vFMIJeU4Ab/uumjLMXvoSRzIF+QOVPzOPBtyQrVEl89Xldab8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bo39O7QM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C234AC433C7; Wed, 31 Jan 2024 23:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742251; bh=FAQxHdV1+8yfMKT7VO4N3syoGgU+YBY/HWjJUz0wdUA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bo39O7QMEzMLWtvIFToHmul4LRH9khxR0VI53DJsD/BjRNEUYbtj/PkM54GRUXhs9 F99vQsM84BZWn0rRZXSg0cwHLy/SXbziPstA+lT57hYFe+4irz57vYAQfVHX8enPQo h10U2GTJMzj/mMgV6Vy+QDdQJyMRy9je8VpjpXwK6S70aeYJc0xJckUkDPjjSqmCpW aTn7b0sTpNINIby+DNGVhXtX8S0JUNVGATW3tZY/clQuCP9SjprLFyvAVvow1QQsoS 2zL0oQXquzZg6+tKvNeN1zgEGeNB1TYsO8s0F5G6R1WhNOxI4Lm6umdrBD+67+2hm7 DD68k3sZPH1AQ== From: Jeff Layton Date: Wed, 31 Jan 2024 18:02:10 -0500 Subject: [PATCH v3 29/47] filelock: make assign_type helper take a file_lock_core pointer 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-29-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=1710; i=jlayton@kernel.org; h=from:subject:message-id; bh=FAQxHdV1+8yfMKT7VO4N3syoGgU+YBY/HWjJUz0wdUA=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlutFxf1cnuwYroAwFYo2+KfzrTvVzYQc5Fr1N5 krCEWo0jNOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbrRcQAKCRAADmhBGVaC Fb7bD/9VC2nnAzFcTcehbut8DHNauWiIU2fl0sOM+qOVaJCMVZRSnuNs3nps0oeNvXiWKOj0nRW RKqO7ghoU1qGCsGe4gtk8WtO/saWLcEKPf/2HzTUctSpB5L51DJiPjQ6oT3fXCRm8Aicguf+WSK RtuVqeut2yt9Bsl4UqpsJrierRVSXUaJtvc7yGyaf06VJUvPPg/eBjY7Y78C1of+N1SnR1kLGmz i+jhtIPiT0W9gMdcJ5EB6nsTq8Hz0Iv8yySlHJlNWzX0RJVTlUNYPKFEbWhiMn4Rpd+G8OoQDjy rJQS36sO9gxdLKEpdh8Iril8xhlyawffnG1peq/jfbSLUo4cTcysKZlc2AhOmtQ6lF8x3QsXg9p x1yscVmwaceDVXbn/ztEoA/0Q86+PqVdx2Y1Jr+xynVZ6JQakAo4JBBKFLc5eTmzNhCxoGjGpoo wVtdOD1SaLoJCptqPHd5e63zdASzvxIxjARki/ZhtaHZ08H7LNOwl12wpCTJv45IYoRlflRBvR2 2mAXiSyQwg9j6TmNLpBKI90Ws2Lz00AXWhNk0jtry4qNqxkNpbJcNYafavngTYFBxh1wiwVszi+ QKKyKed6XR0zbbMtEwXdDc42qu5+IlGOmnA86tK1IUHF+7y5QaZQtvzDONycBdKlXNoRAiB8lZ/ e+uN3ahVzjwYn4Q== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Have assign_type take struct file_lock_core instead of file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index c8fd2964dd98..6892511ed89b 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -439,13 +439,13 @@ static void flock_make_lock(struct file *filp, struct file_lock *fl, int type) fl->fl_end = OFFSET_MAX; } -static int assign_type(struct file_lock *fl, int type) +static int assign_type(struct file_lock_core *flc, int type) { switch (type) { case F_RDLCK: case F_WRLCK: case F_UNLCK: - fl->c.flc_type = type; + flc->flc_type = type; break; default: return -EINVAL; @@ -497,7 +497,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, fl->fl_ops = NULL; fl->fl_lmops = NULL; - return assign_type(fl, l->l_type); + return assign_type(&fl->c, l->l_type); } /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX @@ -552,7 +552,7 @@ static const struct lock_manager_operations lease_manager_ops = { */ static int lease_init(struct file *filp, int type, struct file_lock *fl) { - if (assign_type(fl, type) != 0) + if (assign_type(&fl->c, type) != 0) return -EINVAL; fl->c.flc_owner = filp; @@ -1409,7 +1409,7 @@ static void lease_clear_pending(struct file_lock *fl, int arg) /* We already had a lease on this file; just change its type */ int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) { - int error = assign_type(fl, arg); + int error = assign_type(&fl->c, arg); if (error) return error; -- 2.43.0