From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B91E6C4332F for ; Fri, 25 Nov 2022 13:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbiKYNX4 (ORCPT ); Fri, 25 Nov 2022 08:23:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiKYNXz (ORCPT ); Fri, 25 Nov 2022 08:23:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCC940931; Fri, 25 Nov 2022 05:23:51 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 490D5623FB; Fri, 25 Nov 2022 13:23:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC855C433C1; Fri, 25 Nov 2022 13:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669382630; bh=EGJ1sbVmh8zfuee638fIF/XO+8/weuDlINdqpi5zZtE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=ITYmgIWGeb/7tfCFFc4kVDpIzqmupq1CVJap5fhBl/OT/PtkT4fvz+47vLok2k5y+ 9CRsV+JeWA0KEW85LVZu0FSIZep4yXbkGkq4EGBqpjWl9J4R07ZmdftvaN+jO6GvVh UV+8CnZQsig9drGP5ocCBKCwdeh2CEjv01ouksVCHxKjEnYvQ0VQOwyYDVIftWVHKE GsZuPwqfzHVqHsCgI2NSiNlqWlCXseI+0MB2Oq49i12gvBk+OTgmkxmQgpHo2z4CO0 KgxgBErlyuKDTZUoexdSzNPrYs0i7nPI8jo2JLFO4nl05cBpvzph4ae7XpMCDCSp+4 bOGw2Qy+6YgWg== Message-ID: <1d474f53670771f324745f597ec94b63a006d687.camel@kernel.org> Subject: Re: [PATCH] filelock: move file locking definitions to separate header file From: Jeff Layton To: Al Viro Cc: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Xiubo Li , Ilya Dryomov , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Christine Caulfield , David Teigland , Chuck Lever , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Namjae Jeon , Sergey Senozhatsky , Trond Myklebust , Anna Schumaker , Mark Fasheh , Joel Becker , Joseph Qi , Mike Marshall , Martin Brandenburg , "Darrick J. Wong" , hch@lst.de, linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, devel@lists.orangefs.org, linux-xfs@vger.kernel.org Date: Fri, 25 Nov 2022 08:23:45 -0500 In-Reply-To: References: <20221120210004.381842-1-jlayton@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.1 (3.46.1-1.fc37) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org On Fri, 2022-11-25 at 03:48 +0000, Al Viro wrote: > On Sun, Nov 20, 2022 at 03:59:57PM -0500, Jeff Layton wrote: >=20 > > --- /dev/null > > +++ b/include/linux/filelock.h > > @@ -0,0 +1,428 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +#ifndef _LINUX_FILELOCK_H > > +#define _LINUX_FILELOCK_H > > + > > +#include > > +#include >=20 > Umm... I'd add a comment along the lines of "struct file_lock has > a BS union by fs type; NFS side of things needs nfs_fs_i.h" >=20 Ok. > > +struct lock_manager_operations { > > + void *lm_mod_owner; > > + fl_owner_t (*lm_get_owner)(fl_owner_t); >=20 > Probably take fl_owner_t to some more neutral header... >=20 I left it in fs.h for now. Some of the file_operations prototypes need that typedef, and I figure that anyone who is including filelock.h will almost certainly need to include fs.h anyway. We could move it into a separate header too, but it's probably not worth it. HCH mentioned years ago though that we should just get rid of fl_owner_t altogether and just use 'void *'. I didn't do it at the time because I was focused on other changes, but this might be a good time to change it. > > +#define locks_inode(f) file_inode(f) >=20 > Why do we still have that one, anyway? Separate patch, obviously, > but I would take Occam's Razor to that entity... >=20 I can spin up a patch to nuke that too. I count only 30 callsites remaining anyway. > > +struct files_struct; > > +extern void show_fd_locks(struct seq_file *f, > > + struct file *filp, struct files_struct *files); >=20 > If anything, that would be better off as fl_owner_t... Again, a separate > patch. I'm not sure what you mean here. This prototype hasn't changed, and is only called from procfs. --=20 Jeff Layton