linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH][RFC] fanotify: deprecate uapi FAN_ALL_* constants
Date: Tue, 2 Oct 2018 18:43:35 +0200	[thread overview]
Message-ID: <20181002164335.GJ9127@quack2.suse.cz> (raw)
In-Reply-To: <CAOQ4uxiT55KHWWFB=Oe2RhSGf9DTurJ+JoOLCbo0Euv7Fhg4Pw@mail.gmail.com>

On Tue 02-10-18 19:23:53, Amir Goldstein wrote:
> On Tue, Oct 2, 2018 at 6:56 PM Jan Kara <jack@suse.cz> wrote:
> > Regarding to this patch I have just two nits:
> >
> > > diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> > > index 94b52157bf8d..e5a3c69848e4 100644
> > > --- a/fs/notify/fanotify/fanotify.c
> > > +++ b/fs/notify/fanotify/fanotify.c
> > > @@ -131,8 +131,8 @@ static bool fanotify_should_send_event(struct fsnotify_iter_info *iter_info,
> > >           !(marks_mask & FS_ISDIR & ~marks_ignored_mask))
> > >               return false;
> > >
> > > -     if (event_mask & FAN_ALL_OUTGOING_EVENTS & marks_mask &
> > > -                              ~marks_ignored_mask)
> > > +     if (event_mask & FAN_USER_OUTGOING_EVENTS &
> > > +         marks_mask & ~marks_ignored_mask)
> > >               return true;
> >
> > I don't like the _USER_ part of the constant name. How about _KNOWN_?
> > I.e., FAN_KNOWN_OUTGOING_EVENTS sounds about like what it should?
> >
> 
> Do you mean just for *this* constant? I would rather have some uniformity
> across constants if possible.

No, I meant for all. Sorry for the confusion.

> Errr... Maybe FAN_VALID_EVENTS/FAN_VALID_OUTGOING_EVENTS
> Although _VALID_ is more appropriate for user inputs, so maybe just
> FAN_KNOWN_OUTGOING_EVENTS as an exception to the convention
> is fine.
> 
> Or simply FAN_EVENTS_MASK/FAN_OUTGOING_EVENTS_MASK, like
> the recent new constant FAN_MARK_TYPE_MASK?

Yeah, MASK is fine with me as well. So are the names with VALID. Just pick
one you like the most.

> > > diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
> > > index 096c96f4f16a..a67430811006 100644
> > > --- a/include/linux/fanotify.h
> > > +++ b/include/linux/fanotify.h
> > > @@ -4,6 +4,56 @@
> > >
> > >  #include <uapi/linux/fanotify.h>
> > >
> > > -/* not valid from userspace, only kernel internal */
> > > -#define FAN_MARK_ONDIR               0x00000100
> > > +/*
> > > + * Flags not valid from userspace, only kernel internal.
> > > + * Use high bits so we won't collide with userspace flags.
> > > + */
> > > +#define FAN_MARK_ONDIR               0x80000000
> >
> > This ought to be a separate change as I wrote above.
> >
> 
> Sure and maybe I'll name it FAN_KERN_MARK_ONDIR.

Fine by me.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2018-10-02 23:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 22:01 [PATCH][RFC] fanotify: deprecate uapi FAN_ALL_* constants Amir Goldstein
2018-10-02 15:56 ` Jan Kara
2018-10-02 16:23   ` Amir Goldstein
2018-10-02 16:43     ` Jan Kara [this message]

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=20181002164335.GJ9127@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.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).