Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1971999rdb; Wed, 31 Jan 2024 15:21:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IED4s6KxfJxqsWA3/uNBQ2ffGuuQcay3vOPZZVRBpGi3aeCVIX0JM9gGKr2xSmXs9+ul5X7 X-Received: by 2002:a0c:e154:0:b0:68c:4013:d52c with SMTP id c20-20020a0ce154000000b0068c4013d52cmr789988qvl.23.1706743271954; Wed, 31 Jan 2024 15:21:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706743271; cv=pass; d=google.com; s=arc-20160816; b=Rb/sg/9c1D2wdjdWvt6oPidhgM/97amkqBM4zqrAp2Yx0lBr96nd99jpmgRp15iyAQ SbNYK4PqAW6erQkDWXFgGoUMLYVliOLZ0rfkBVSCyoouCoWfvWh7+y2DFhWIMdR+2ZHA U9DL62ifsMbXjLO8fqAQ42JPypWjV0K6UU7g5Rk2A864iLWRUV21uhxr6GAyu+ROK7vC 3sd4jySl8NhT5gts82xrxRxaZmNEMhXBc1lJlS2yRs/P9ju1hUdbqqukPgYNArOUBvXD HP2shCxbzQVHnEZp7hjDUNFW5Ng3ldxD0ZRjbyB1ZJXMf6j1o9v3QOwvQc7P2vbaAmR+ PmEw== 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=++mO/inEmcQX4SBT5wkN1uyeryA9crAcMxVfmVxU0S8=; fh=7NZiSAZrRYszuatpSaNV39b2cM2fzEN2iHI8EfXs2Vg=; b=uo2hH8c5/EXZkcBv4PR1gGmOecCHWvRXvIYF+SVBE/36ymsT7YhqK5ZYZmcXZDS3Im lhBQ1Vr8qbBcuunljEB+ERKjS4gI8Q4ET8pSlFzOR68P3W0tsTXHw+PaLWj5o6pwveHq qMPwACBob6HziYLFGt9JxPxOITv1fK0JJUAoEnSIq7NBopotr2OIrHfEyCZbfl03nFJY Pux+rc2cfHA95rhHXK0QzbNQowqLqbCeg+G4rNrIez78qgC1ubZ9+dM+WtqaZ+wZaIwX 56cYx8D5zOjmXq1kR1xirvHiwvDDsRGo5hYcUFQ0LaQSu0eY3p48Fc0CAh9F/RNt+CDF FLPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EzP645gD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1676-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1676-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 u11-20020a05620a120b00b00783d9e90923si12221122qkj.519.2024.01.31.15.21.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:21:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1676-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=EzP645gD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1676-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1676-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 4CBEC1C25CF6 for ; Wed, 31 Jan 2024 23:20:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECBE814A0B9; Wed, 31 Jan 2024 23:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EzP645gD" 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 B33863A8F2; Wed, 31 Jan 2024 23:04:51 +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=1706742291; cv=none; b=k0u4Z+Ht0KdHIRe0EXNEzWtIvqXR4Gq4rvSI7vAObRea1W6hAkwhDvS2WBEhBzy/V4r2VK9CE7FooUMad44TkQgvpEkngwWhomgxybESW/L6bnT++VyGfxRdhTnOS8p6tgts61ggpNeaDRU0TON6x39k844CW8eza4UbPLiIlyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742291; c=relaxed/simple; bh=606xHOV7REs/CUmLZVKJCoqRw4w+gjwX2JuKeDHEpfs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RiqvtKuAWpN1UuGYPz8T42b5TXKq/QZn+MNa5mriruv/i9JaOTxX5CCN9FXnJp589hScFh+8v+cWAk3ZcpJ4HvOxgBfVbTC8JouAU8GghgGahgO4O4IogCvaRqu+xp66Fa+l6eTNNawrw27r0PzCuieuWdkopJrihX1Fd5I6Gc8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EzP645gD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 738E9C43609; Wed, 31 Jan 2024 23:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742291; bh=606xHOV7REs/CUmLZVKJCoqRw4w+gjwX2JuKeDHEpfs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EzP645gDJBv1zggBtj+hRyEisysLv0Pa+ri4P8BUe6hP92qCWl0sTTLLHfw20CG57 joB9diNPbQINssmHU3XR0tsjQ/dpET4zTrP2RzP961PqvokoWHNBds5SZFmMpHhwMY NhSLMjov3RK7TCYJNS0RBrMyx083IYMZqC2PLY0qYDYHjVTxfBYBYZblr7QC9uf9Sy EIOPZhh6k+7DIPkm3VAxDqjWkQz6JUbxaKeXRDwDP7PVjhQ2QGVtau7iUklgBW+OCm mkYo5ibk2xjvWRtdFUZIZG/GFSJH+0q9KliHV4cgO3d1BnAiQNZlIcbg6CWhS5ZM47 xux7U4htrBF8Q== From: Jeff Layton Date: Wed, 31 Jan 2024 18:02:20 -0500 Subject: [PATCH v3 39/47] fuse: adapt to breakup of struct file_lock 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-39-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=2506; i=jlayton@kernel.org; h=from:subject:message-id; bh=606xHOV7REs/CUmLZVKJCoqRw4w+gjwX2JuKeDHEpfs=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlutFzhpKXOO+ReJrR0/Wtxd47aXLz+odJTpqdJ XgznpGWy26JAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbrRcwAKCRAADmhBGVaC FW4AD/0d6m0tKbhRrgZOQYosgQpUX6OwEpIrT/cxfgJJ5ETeRG3V4fuVoUY9AIL77bDZ9399X8+ k1mriUxlAXGv1dgdx2mSLd3dSrV0pvmc7zio5NIO7fPcjmhP0NoddT36cTCYoBPtT6tPWwQGbyw QSnydNxkAUWqtymkYNLwgzGYTjYOuv2dX9e0IiIlaztHb2ntAePN+CPmyulR9EvN1R6uMwsIkvJ cdIhQefFhiDRLacB0N0TrfrF9JZt2yFtr2Ua1CTYsubzW67/qMyxsfRHiThJ+/PXqtc52Vb+TVY /A1l+oHmP8OUWsVEl6hfJnK4eEDD8l3RuJjAou35GeoXcqPI2+MWSAaw4NseBegDgAr/Ps4pP7t PmZcpXUEJDE2oXJ5iQ9Z17EKK1skeKgLelYOcHvyiNhxEEPaJngHhzHBQPoYIDoZr5u79sLJqoD rapDoEuNFf6Hnuu+8F7DjEguJZEAg16deRjZhO05R9s0cFW+9mNRPMs0a11aOWFMRmOC9C/34oY vbgLxCBVd6NSY26dl4lraeIW2gjEO8EtpPsAlEZqDVhILobITpVMW0e7OJgvWdDl+GBblKhTdv+ jIMiMYxs6U9B0o5s7H6LrtFMpq0w6gS3edNY2FT08hkXaRij/pZb1fjZbtLa+5vTw2I/FLAO84a fTX5emi7Aj9eN4w== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Most of the existing APIs have remained the same, but subsystems that access file_lock fields directly need to reach into struct file_lock_core now. Signed-off-by: Jeff Layton --- fs/fuse/file.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 2757870ee6ac..c007b0f0c3a7 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -18,7 +18,6 @@ #include #include #include -#define _NEED_FILE_LOCK_FIELD_MACROS #include #include @@ -2510,14 +2509,14 @@ static int convert_fuse_file_lock(struct fuse_conn *fc, * translate it into the caller's pid namespace. */ rcu_read_lock(); - fl->fl_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns); + fl->c.flc_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns); rcu_read_unlock(); break; default: return -EIO; } - fl->fl_type = ffl->type; + fl->c.flc_type = ffl->type; return 0; } @@ -2531,10 +2530,10 @@ static void fuse_lk_fill(struct fuse_args *args, struct file *file, memset(inarg, 0, sizeof(*inarg)); inarg->fh = ff->fh; - inarg->owner = fuse_lock_owner_id(fc, fl->fl_owner); + inarg->owner = fuse_lock_owner_id(fc, fl->c.flc_owner); inarg->lk.start = fl->fl_start; inarg->lk.end = fl->fl_end; - inarg->lk.type = fl->fl_type; + inarg->lk.type = fl->c.flc_type; inarg->lk.pid = pid; if (flock) inarg->lk_flags |= FUSE_LK_FLOCK; @@ -2571,8 +2570,8 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) struct fuse_mount *fm = get_fuse_mount(inode); FUSE_ARGS(args); struct fuse_lk_in inarg; - int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK; - struct pid *pid = fl->fl_type != F_UNLCK ? task_tgid(current) : NULL; + int opcode = (fl->c.flc_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK; + struct pid *pid = fl->c.flc_type != F_UNLCK ? task_tgid(current) : NULL; pid_t pid_nr = pid_nr_ns(pid, fm->fc->pid_ns); int err; @@ -2582,7 +2581,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) } /* Unlock on close is handled by the flush method */ - if ((fl->fl_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX) + if ((fl->c.flc_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX) return 0; fuse_lk_fill(&args, file, fl, opcode, pid_nr, flock, &inarg); -- 2.43.0