Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp48823rdb; Tue, 16 Jan 2024 14:39:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+CMoUPqmtvhzb27cYYoIQMM0xXzBYFM2YPfjyAr/Rdym144+J5CC7dBWi7Z8yv0XKwGxJ X-Received: by 2002:a05:6a21:1692:b0:19b:6424:cd7d with SMTP id np18-20020a056a21169200b0019b6424cd7dmr464281pzb.27.1705444797435; Tue, 16 Jan 2024 14:39:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705444797; cv=pass; d=google.com; s=arc-20160816; b=vYgVt7fDdumxwHE9c8M27WJ9BcI3jJsLdn3rJ6zHtKDBtr4DkoMUBwz0bp04GDIFV1 EL+C/MAgHxMY2fBc97OsyAOH9VU84NPy9R/yoPMclWVUvm3bKN+ZQ0LB/znbXl3Hpsv2 xy1Atbm6L16AKYPbqwzoZ2iU/ciEaDfi96S6Lb879ed6/FuruGOVZO3jn1BKTDadO/iw SRuMM8lYH2PwAsik7D6cpQgEAqh2DIWm6z29mXeomwN2dfcy7b93eBhRp8+CHiafQUdU 4W9fm5Cf4KPtRZ1d8iv3vL2U1UlTvDyu02t/QxzPXp22l47aPUr1Hl9aFBZnkrVeREDt J1Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:references:in-reply-to:subject:cc:to:from :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding; bh=qZqEZmsALGwaM9l2g/hARo8peMaASalSu2YJU9dwWXg=; fh=mAq26R6urpe+KOcIReX0RRLqFRiZaH7bEHzigtUdAdU=; b=L3ES5Cu4e6hBnA1iEHJBfyYo0n4i59G2BVQKp1zWfWiTjr/22CFqapVyYtt4MWSpZe TqhREMg8XFNF4YGUCzmeIUxoamyG2W1T3w0lRj+EwfukFeJk72VtoWjYPJ0VNeoVnQFT Ead7StXpE3obwTQdilyEZZQY7+utQkpdzxEP5N+XUjyJEd8EJiAKz6LG6Bnv5wrLUvVN 1PLu/GuILXH+KYqPsxuddQ186d46NW9qQQG0MH6dGwwKP63qx7IA2UXzp8xF/4bZnFvw EKLgHT5D6a2czULrNzI/UkyJvU0Uze/73R8yGB2acXq8mXuXM2BbUTnKEc+IpInvwYOc NzbQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f30-20020a056a000b1e00b006daab53f6bdsi181624pfu.298.2024.01.16.14.39.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 14:39:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1166-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E585128E3D6 for ; Tue, 16 Jan 2024 22:37:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B23F604D6; Tue, 16 Jan 2024 22:07:22 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 991F2604C3; Tue, 16 Jan 2024 22:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705442842; cv=none; b=mxA/fBe0P7/k1b/gR4jrApKQvmo2A/g4J4NaB5GXODTEbtUlFeVYyEfSykWWeU87L/JW3I2KM+CXz2r2K1T9i0crFFVtmQWPE1TK83fq/r1OTnpAYlwCfzA2aNbAOgYg1WsWlZxn85NRsC1cQz0PcCJEYS0DaXwPRnFRz6raDQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705442842; c=relaxed/simple; bh=IYYnR2EFburvoZquoTc+yWa7KgPsEyYwG1E6dao281I=; h=Received:Received:Received:Content-Type:Content-Transfer-Encoding: MIME-Version:From:To:Cc:Subject:In-reply-to:References:Date: Message-id:X-Spamd-Result:X-Rspamd-Server:X-Rspamd-Queue-Id: X-Spam-Level:X-Spam-Score:X-Spam-Flag; b=pDF6nvhUZZq3diTsTd1xPhM1zGrgIy4BzgfRcKZKyhhZW8ye8fSbyg7NuJIU2ye13gL69oO2YSqpXR+85pE6OMgaSIZy2M/TKCmL+snyjGwgJIEr0puHO5M+9Tfhy5vYPmc08w2RBJGUCt5TJCzn0riVgvXPKwziVEucDK032Vo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B7C1322168; Tue, 16 Jan 2024 22:07:18 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2BB4613751; Tue, 16 Jan 2024 22:07:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0xBrNAj+pmWWeAAAD6G6ig (envelope-from ); Tue, 16 Jan 2024 22:07:04 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "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" , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , "Jan Kara" , "Mark Fasheh" , "Joel Becker" , "Joseph Qi" , "Steve French" , "Paulo Alcantara" , "Ronnie Sahlberg" , "Shyam Prasad N" , "Namjae Jeon" , "Sergey Senozhatsky" , "Steven Rostedt" , "Masami Hiramatsu" , "Mathieu Desnoyers" , 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, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, "Jeff Layton" Subject: Re: [PATCH 01/20] filelock: split common fields into struct file_lock_core In-reply-to: <20240116-flsplit-v1-1-c9d0f4370a5d@kernel.org> References: <20240116-flsplit-v1-0-c9d0f4370a5d@kernel.org>, <20240116-flsplit-v1-1-c9d0f4370a5d@kernel.org> Date: Wed, 17 Jan 2024 09:07:02 +1100 Message-id: <170544282220.23031.10628392788633554158@noble.neil.brown.name> Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: B7C1322168 X-Spam-Level: X-Spam-Score: -4.00 X-Spam-Flag: NO On Wed, 17 Jan 2024, Jeff Layton wrote: > In a future patch, we're going to split file leases into their own > structure. Since a lot of the underlying machinery uses the same fields > move those into a new file_lock_core, and embed that inside struct > file_lock. > > Signed-off-by: Jeff Layton > --- > include/linux/filelock.h | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/include/linux/filelock.h b/include/linux/filelock.h > index 95e868e09e29..7825511c1c11 100644 > --- a/include/linux/filelock.h > +++ b/include/linux/filelock.h > @@ -85,8 +85,9 @@ bool opens_in_grace(struct net *); > * > * Obviously, the last two criteria only matter for POSIX locks. > */ > -struct file_lock { > - struct file_lock *fl_blocker; /* The lock, that is blocking us */ > + > +struct file_lock_core { > + struct file_lock *fl_blocker; /* The lock that is blocking us */ > struct list_head fl_list; /* link into file_lock_context */ > struct hlist_node fl_link; /* node in global lists */ > struct list_head fl_blocked_requests; /* list of requests with > @@ -102,6 +103,10 @@ struct file_lock { > int fl_link_cpu; /* what cpu's list is this on? */ > wait_queue_head_t fl_wait; > struct file *fl_file; > +}; > + > +struct file_lock { > + struct file_lock_core fl_core; > loff_t fl_start; > loff_t fl_end; > If I we doing this, I would rename all the fields in file_lock_core to have an "flc_" prefix, and add some #defines like #define fl_list fl_core.flc_list so there would be no need to squash this with later patches to achieve bisectability. The #defines would be removed after the coccinelle scripts etc are applied. I would also do the "convert some internal functions" patches *before* the bulk conversion of fl_foo to fl_code.flc_foo so that those functions don't get patched twice. But this is all personal preference. If you prefer your approach, please leave it that way. The only clear benefit of my approach is that you don't need to squash patches together, and that is probably not a big deal. Thanks, NeilBrown