cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] filelock: move file locking definitions to separate header file
Date: Fri, 25 Nov 2022 08:23:45 -0500	[thread overview]
Message-ID: <1d474f53670771f324745f597ec94b63a006d687.camel@kernel.org> (raw)
In-Reply-To: <Y4A6/ozhUncxbimi@ZenIV>

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:
> 
> > --- /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 <linux/list.h>
> > +#include <linux/nfs_fs_i.h>
> 
> 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"
> 

Ok.

> > +struct lock_manager_operations {
> > +	void *lm_mod_owner;
> > +	fl_owner_t (*lm_get_owner)(fl_owner_t);
> 
> Probably take fl_owner_t to some more neutral header...
> 

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)
> 
> Why do we still have that one, anyway?  Separate patch, obviously,
> but I would take Occam's Razor to that entity...
> 

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);
> 
> 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.

-- 
Jeff Layton <jlayton@kernel.org>


  reply	other threads:[~2022-11-25 13:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 20:59 [Cluster-devel] [PATCH] filelock: move file locking definitions to separate header file Jeff Layton
2022-11-21  1:26 ` Xiubo Li
2022-11-22  3:44   ` Matthew Wilcox
2022-11-21  7:59 ` Christoph Hellwig
2022-11-21  9:19 ` Christian Brauner
2022-11-21 14:40 ` Chuck Lever III
2022-11-21 15:31 ` David Howells
2022-11-21 16:21 ` Steve French
2022-11-21 16:53 ` Darrick J. Wong
2022-11-21 17:16   ` Jeff Layton
2022-11-21 17:27     ` Darrick J. Wong
2022-11-21 19:06       ` Jeff Layton
2022-11-22  1:51 ` Joseph Qi
2022-11-22 12:20   ` Jeff Layton
2022-11-22 13:54     ` Joseph Qi
2022-11-22  3:51 ` Matthew Wilcox
2022-11-22  6:06   ` Christoph Hellwig
2022-11-22 11:13   ` Jeff Layton
2022-11-25  3:34   ` Al Viro
2022-11-25  3:48 ` Al Viro
2022-11-25 13:23   ` Jeff Layton [this message]
2022-11-25 16:44     ` Al Viro
2022-11-28 10:53       ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d474f53670771f324745f597ec94b63a006d687.camel@kernel.org \
    --to=jlayton@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).