diff mbox series

[v6,04/21] fsnotify: Reserve mark flag bits for backends

Message ID 20210812214010.3197279-5-krisman@collabora.com (mailing list archive)
State New, archived
Headers show
Series File system wide monitoring | expand

Commit Message

Gabriel Krisman Bertazi Aug. 12, 2021, 9:39 p.m. UTC
Split out the final bits of struct fsnotify_mark->flags for use by a
backend.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>

Changes since v1:
  - turn consts into defines (jan)
---
 include/linux/fsnotify_backend.h | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Comments

Amir Goldstein Aug. 13, 2021, 7:28 a.m. UTC | #1
On Fri, Aug 13, 2021 at 12:40 AM Gabriel Krisman Bertazi
<krisman@collabora.com> wrote:
>
> Split out the final bits of struct fsnotify_mark->flags for use by a
> backend.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
>
> Changes since v1:
>   - turn consts into defines (jan)
> ---
>  include/linux/fsnotify_backend.h | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
> index 1ce66748a2d2..ae1bd9f06808 100644
> --- a/include/linux/fsnotify_backend.h
> +++ b/include/linux/fsnotify_backend.h
> @@ -363,6 +363,20 @@ struct fsnotify_mark_connector {
>         struct hlist_head list;
>  };
>
> +enum fsnotify_mark_bits {
> +       FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY,
> +       FSN_MARK_FL_BIT_ALIVE,
> +       FSN_MARK_FL_BIT_ATTACHED,
> +       FSN_MARK_PRIVATE_FLAGS,
> +};
> +
> +#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY \
> +       (1 << FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY)
> +#define FSNOTIFY_MARK_FLAG_ALIVE \
> +       (1 << FSN_MARK_FL_BIT_ALIVE)
> +#define FSNOTIFY_MARK_FLAG_ATTACHED \
> +       (1 << FSN_MARK_FL_BIT_ATTACHED)
> +
>  /*
>   * A mark is simply an object attached to an in core inode which allows an
>   * fsnotify listener to indicate they are either no longer interested in events
> @@ -398,9 +412,7 @@ struct fsnotify_mark {
>         struct fsnotify_mark_connector *connector;
>         /* Events types to ignore [mark->lock, group->mark_mutex] */
>         __u32 ignored_mask;
> -#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x01
> -#define FSNOTIFY_MARK_FLAG_ALIVE               0x02
> -#define FSNOTIFY_MARK_FLAG_ATTACHED            0x04
> +       /* Upper bits [31:PRIVATE_FLAGS] are reserved for backend usage */

I don't understand what [31:PRIVATE_FLAGS] means

Otherwise:

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Thanks,
Amir.
Jan Kara Aug. 16, 2021, 1:15 p.m. UTC | #2
On Fri 13-08-21 10:28:27, Amir Goldstein wrote:
> On Fri, Aug 13, 2021 at 12:40 AM Gabriel Krisman Bertazi
> <krisman@collabora.com> wrote:
> >
> > Split out the final bits of struct fsnotify_mark->flags for use by a
> > backend.
> >
> > Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
> >
> > Changes since v1:
> >   - turn consts into defines (jan)
> > ---
> >  include/linux/fsnotify_backend.h | 18 +++++++++++++++---
> >  1 file changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
> > index 1ce66748a2d2..ae1bd9f06808 100644
> > --- a/include/linux/fsnotify_backend.h
> > +++ b/include/linux/fsnotify_backend.h
> > @@ -363,6 +363,20 @@ struct fsnotify_mark_connector {
> >         struct hlist_head list;
> >  };
> >
> > +enum fsnotify_mark_bits {
> > +       FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY,
> > +       FSN_MARK_FL_BIT_ALIVE,
> > +       FSN_MARK_FL_BIT_ATTACHED,
> > +       FSN_MARK_PRIVATE_FLAGS,
> > +};
> > +
> > +#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY \
> > +       (1 << FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY)
> > +#define FSNOTIFY_MARK_FLAG_ALIVE \
> > +       (1 << FSN_MARK_FL_BIT_ALIVE)
> > +#define FSNOTIFY_MARK_FLAG_ATTACHED \
> > +       (1 << FSN_MARK_FL_BIT_ATTACHED)
> > +
> >  /*
> >   * A mark is simply an object attached to an in core inode which allows an
> >   * fsnotify listener to indicate they are either no longer interested in events
> > @@ -398,9 +412,7 @@ struct fsnotify_mark {
> >         struct fsnotify_mark_connector *connector;
> >         /* Events types to ignore [mark->lock, group->mark_mutex] */
> >         __u32 ignored_mask;
> > -#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x01
> > -#define FSNOTIFY_MARK_FLAG_ALIVE               0x02
> > -#define FSNOTIFY_MARK_FLAG_ATTACHED            0x04
> > +       /* Upper bits [31:PRIVATE_FLAGS] are reserved for backend usage */
> 
> I don't understand what [31:PRIVATE_FLAGS] means

I think it should be [FSN_MARK_PRIVATE_FLAGS:31] (identifying a range of
bits). I'd maybe write just "Bits starting from FSN_MARK_PRIVATE_FLAGS are
reserved for backend usage". With this fixed feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
Gabriel Krisman Bertazi Aug. 23, 2021, 2:36 p.m. UTC | #3
Jan Kara <jack@suse.cz> writes:

> On Fri 13-08-21 10:28:27, Amir Goldstein wrote:
>> On Fri, Aug 13, 2021 at 12:40 AM Gabriel Krisman Bertazi
>> <krisman@collabora.com> wrote:
>> >
>> > Split out the final bits of struct fsnotify_mark->flags for use by a
>> > backend.
>> >
>> > Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
>> >
>> > Changes since v1:
>> >   - turn consts into defines (jan)
>> > ---
>> >  include/linux/fsnotify_backend.h | 18 +++++++++++++++---
>> >  1 file changed, 15 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
>> > index 1ce66748a2d2..ae1bd9f06808 100644
>> > --- a/include/linux/fsnotify_backend.h
>> > +++ b/include/linux/fsnotify_backend.h
>> > @@ -363,6 +363,20 @@ struct fsnotify_mark_connector {
>> >         struct hlist_head list;
>> >  };
>> >
>> > +enum fsnotify_mark_bits {
>> > +       FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY,
>> > +       FSN_MARK_FL_BIT_ALIVE,
>> > +       FSN_MARK_FL_BIT_ATTACHED,
>> > +       FSN_MARK_PRIVATE_FLAGS,
>> > +};
>> > +
>> > +#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY \
>> > +       (1 << FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY)
>> > +#define FSNOTIFY_MARK_FLAG_ALIVE \
>> > +       (1 << FSN_MARK_FL_BIT_ALIVE)
>> > +#define FSNOTIFY_MARK_FLAG_ATTACHED \
>> > +       (1 << FSN_MARK_FL_BIT_ATTACHED)
>> > +
>> >  /*
>> >   * A mark is simply an object attached to an in core inode which allows an
>> >   * fsnotify listener to indicate they are either no longer interested in events
>> > @@ -398,9 +412,7 @@ struct fsnotify_mark {
>> >         struct fsnotify_mark_connector *connector;
>> >         /* Events types to ignore [mark->lock, group->mark_mutex] */
>> >         __u32 ignored_mask;
>> > -#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x01
>> > -#define FSNOTIFY_MARK_FLAG_ALIVE               0x02
>> > -#define FSNOTIFY_MARK_FLAG_ATTACHED            0x04
>> > +       /* Upper bits [31:PRIVATE_FLAGS] are reserved for backend usage */
>> 
>> I don't understand what [31:PRIVATE_FLAGS] means
>
> I think it should be [FSN_MARK_PRIVATE_FLAGS:31] (identifying a range of
> bits). I'd maybe write just "Bits starting from FSN_MARK_PRIVATE_FLAGS are
> reserved for backend usage". With this fixed feel free to add:

Thank you, I will address the comment and add your reviewed-by tags.
diff mbox series

Patch

diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 1ce66748a2d2..ae1bd9f06808 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -363,6 +363,20 @@  struct fsnotify_mark_connector {
 	struct hlist_head list;
 };
 
+enum fsnotify_mark_bits {
+	FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY,
+	FSN_MARK_FL_BIT_ALIVE,
+	FSN_MARK_FL_BIT_ATTACHED,
+	FSN_MARK_PRIVATE_FLAGS,
+};
+
+#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY \
+	(1 << FSN_MARK_FL_BIT_IGNORED_SURV_MODIFY)
+#define FSNOTIFY_MARK_FLAG_ALIVE \
+	(1 << FSN_MARK_FL_BIT_ALIVE)
+#define FSNOTIFY_MARK_FLAG_ATTACHED \
+	(1 << FSN_MARK_FL_BIT_ATTACHED)
+
 /*
  * A mark is simply an object attached to an in core inode which allows an
  * fsnotify listener to indicate they are either no longer interested in events
@@ -398,9 +412,7 @@  struct fsnotify_mark {
 	struct fsnotify_mark_connector *connector;
 	/* Events types to ignore [mark->lock, group->mark_mutex] */
 	__u32 ignored_mask;
-#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY	0x01
-#define FSNOTIFY_MARK_FLAG_ALIVE		0x02
-#define FSNOTIFY_MARK_FLAG_ATTACHED		0x04
+	/* Upper bits [31:PRIVATE_FLAGS] are reserved for backend usage */
 	unsigned int flags;		/* flags [mark->lock] */
 };