Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1698798rdb; Thu, 25 Jan 2024 03:39:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyQIV4Xl/nV7PKSj8SAzKBQdZ8I2/o2vKJ0qi6LJryH29jAEklpde3WnR8e4zf7VWJTHDr X-Received: by 2002:a05:6a20:8c1d:b0:19a:bbb7:2d47 with SMTP id j29-20020a056a208c1d00b0019abbb72d47mr845880pzh.88.1706182776751; Thu, 25 Jan 2024 03:39:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706182776; cv=pass; d=google.com; s=arc-20160816; b=0ipc30J88vcTG5lNNHwGrnwCR++CzOnc2FOQZ3SyxswowSXxwf+js7dma+PonsEIYC NNY/JsMp5A8DgpoINwta9oSnQBK0ZTOZhBPMNFTpyGcpynjKHJPpDDKYKno3jpKEcFes 76bc2BNd3VtXPRfwTwG1I7vAYRzesYzDaNrIGN0qZBdjfxEd0nkKZm20MlYkOmCrabu1 TaPAetUT9zh3KbIuXne59gRd60MJtVJ84EubVBHc43UxbcsrJIrU00Ed6gHI/38Zwb3d RoeKqpKTVFMRgPYnT7FCUWFYgS/BYyRUXAFZcVPw6NzjG4MxxPjlZ4xH6mBS7ZjpmvCO 2qig== 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=K4x78ZiZGhY8oIkEvfNMwKwQ+YtuUbEcuFkSJARGS1s=; fh=AED2lrIQZhdppGHbaRrNz6/BI48B+mbutB2egpFPmJc=; b=wgF1eSZTq1Ahjci1Zn0UH/7dj7jNLV42kbMhrhEPbNL9lETPVke+CUDOcFLMnkzikM FfbcjTAsEVBoZQB/JLZqF+j66JVnNnWex4MX3B4wDr7G2sA1Zi95UAVyvBoTfabaloJw dM9oKO4Zyo0+EuRjd9xIINx8doShZCQKCLYez1BzSd18SGpziKagL10Yt+CPieRAY32I 2xx72Yj3fawgGuloA/kAnk6gDOf0wb8BhbeRFUal7Akp27mBSwXiDz+rFYeSaTXF8+HU 8Vn1e9aZH4VMtZFf4C9S3fTauyIy0mUqwLLifHmyWe6A1Pxhi1rr0uKIqRBdnnzDpAjj vNhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pMG1+CCt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1366-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v18-20020a62a512000000b006dbaf6c303bsi12066616pfm.6.2024.01.25.03.39.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 03:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pMG1+CCt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-1366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1366-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 53B3DB350B3 for ; Thu, 25 Jan 2024 11:01:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8149F65BD7; Thu, 25 Jan 2024 10:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pMG1+CCt" 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 D0B5865BD6; Thu, 25 Jan 2024 10:45:23 +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=1706179524; cv=none; b=CDtWFXV3mH8ZKMA+Udm2C33iMACBOr/YPMA6dGGgsngLVAtZu+fqZoZf3oOZSD7Z/kUYR9WSoL/jnrimIk17TYOArDstcV8sPTCPhZFLtE5Y8q6RSMxFX54ZcERkFrGHBbu4XVQlgWuKubMh8OD//AOJVhpZT/V3vab2AGbcyBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706179524; c=relaxed/simple; bh=May8tXK/aU9P09eCGMe0XoJv+iSqKO1K5ZKsSFCQogk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O4DCm7rMflp7K9zZcQ9kkGRMCntl2pzntF//aubc5Dsa/gTsp/0mAvnyy8fCF5CP1Bb4pKhbhgK3j0XcpPOm6sU2RNslS5hTJB04NZIgSafS6BOGvBzTO85i/K+hD+ZEurlWx9LQ4dQmGl2RXfcc9+uyG/M1zZ/rsBPLsjev/tc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pMG1+CCt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AD52C43399; Thu, 25 Jan 2024 10:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706179521; bh=May8tXK/aU9P09eCGMe0XoJv+iSqKO1K5ZKsSFCQogk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pMG1+CCtlySiyvB+Qu5e+QSRgO2YlQnNL8nh97HGU2zVZRA1ZYk+NTHR17fnjilI+ XpDdy69YwLaWbmQ9N/d7qtdZCvmbdEG2SqO+hTS4wLNC9o6NC+iKL6n3hs1XnaXvZU 6kRFJUMFlQG8uzbDboyh/3DaEacUZlQMcp7N4gIcXM/G9/iCZ3FAkKfq+oziCUp233 KJlstnIzOq1nx5vAknGxgyVMEDX7s0AJez77L4+cPH4I/Ix1wgk6auWuXjDdIa6Cit C+ia+qhUAU3mNd9nob/B7vzawuVNsyMvuOkqVckszSSdCgDZgXMkTodaUTtFnHBCro HbTtqq/yO2/lw== From: Jeff Layton Date: Thu, 25 Jan 2024 05:43:14 -0500 Subject: [PATCH v2 33/41] gfs2: 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: <20240125-flsplit-v2-33-7485322b62c7@kernel.org> References: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> In-Reply-To: <20240125-flsplit-v2-0-7485322b62c7@kernel.org> To: Christian Brauner , Alexander Viro , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Xiubo Li , Ilya Dryomov , Alexander Aring , David Teigland , Miklos Szeredi , Andreas Gruenbacher , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Jan Kara , Mark Fasheh , Joel Becker , Joseph Qi , Steve French , Paulo Alcantara , Shyam Prasad N , Namjae Jeon , Sergey Senozhatsky , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Ronnie Sahlberg 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 X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2826; i=jlayton@kernel.org; h=from:subject:message-id; bh=May8tXK/aU9P09eCGMe0XoJv+iSqKO1K5ZKsSFCQogk=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlsjs+crUFt4hWuqAUhKVtDFUTGdJiHAxl8qo6z jTpTEqOhGSJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZbI7PgAKCRAADmhBGVaC FSXFEAC2Ij6vquQrJJuMnnGDLS15DLOkNyj/OzO/ognOixJocSiMEvgsjf7b9t6/sxFknKzi6N4 kfUk2pzXp3FJ/3QTr+urjiw7MdpwP/KVmIeC/Inn9mttlPquZOqPPKmjGHK+g8PK0X4i7XVExTD clqeJmFWI5tC7ZipLCyJKxVOGhbrO/H7n6mbfk6chsYWbS2lHX6nOOTiowJB2ekjUmQKW3PzcRm lZGFCxs8eq5Y6c5q8Dam3XwfJdIPDclh1ZkThWjkL2JkEah5IAdZiqJD2F3rrbbauMaRvUDkt29 5DTebMEEQxLoOv1+FmFOR1vv1lFPRm/IArkz0zDnY4OkPqEI4Y5dFtjlO7mVC87quTeJdtR6D+p zbypfBkT5LaP1CFVr5rGcsXv62yFuprKPKvILIT5a8/I4nY/B6qbOsVzHuMuw04/bOn6RcxjyGy QDs0HU/2zwDdEfBjONMBqycoWEkYzqGc8lskjs3lp0NdIeFU5vfbABqI1QWTzTZoSFSxn5WkYwW 8HROwXlT5mMJVeUndmumdfY4D+Zt/JhoBvLXbF3Ej04SJD1jgBuWm76X0tB1T2MpAtnz0we+ziQ iKB/s5ugzfWnEY+QWBQI7QD8GFMxcXAaOXQIF8chaf0RhJ4SFdsze6q6KlBp/acpPzZpT0J4T6T rO87ah3Dt3EaXMw== 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/gfs2/file.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 9e7cd054e924..dc0c4f7d7cc7 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -15,7 +15,6 @@ #include #include #include -#define _NEED_FILE_LOCK_FIELD_MACROS #include #include #include @@ -1441,10 +1440,10 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host); struct lm_lockstruct *ls = &sdp->sd_lockstruct; - if (!(fl->fl_flags & FL_POSIX)) + if (!(fl->fl_core.flc_flags & FL_POSIX)) return -ENOLCK; if (gfs2_withdrawing_or_withdrawn(sdp)) { - if (fl->fl_type == F_UNLCK) + if (fl->fl_core.flc_type == F_UNLCK) locks_lock_file_wait(file, fl); return -EIO; } @@ -1452,7 +1451,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) return dlm_posix_cancel(ls->ls_dlm, ip->i_no_addr, file, fl); else if (IS_GETLK(cmd)) return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl); - else if (fl->fl_type == F_UNLCK) + else if (fl->fl_core.flc_type == F_UNLCK) return dlm_posix_unlock(ls->ls_dlm, ip->i_no_addr, file, fl); else return dlm_posix_lock(ls->ls_dlm, ip->i_no_addr, file, cmd, fl); @@ -1484,7 +1483,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) int error = 0; int sleeptime; - state = (fl->fl_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; + state = (fl->fl_core.flc_type == F_WRLCK) ? LM_ST_EXCLUSIVE : LM_ST_SHARED; flags = GL_EXACT | GL_NOPID; if (!IS_SETLKW(cmd)) flags |= LM_FLAG_TRY_1CB; @@ -1496,8 +1495,8 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) if (fl_gh->gh_state == state) goto out; locks_init_lock(&request); - request.fl_type = F_UNLCK; - request.fl_flags = FL_FLOCK; + request.fl_core.flc_type = F_UNLCK; + request.fl_core.flc_flags = FL_FLOCK; locks_lock_file_wait(file, &request); gfs2_glock_dq(fl_gh); gfs2_holder_reinit(state, flags, fl_gh); @@ -1558,10 +1557,10 @@ static void do_unflock(struct file *file, struct file_lock *fl) static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl) { - if (!(fl->fl_flags & FL_FLOCK)) + if (!(fl->fl_core.flc_flags & FL_FLOCK)) return -ENOLCK; - if (fl->fl_type == F_UNLCK) { + if (fl->fl_core.flc_type == F_UNLCK) { do_unflock(file, fl); return 0; } else { -- 2.43.0