On Tue 04-09-18 16:03:07, Jan Kara wrote:
On Fri 27-07-18 00:47:37, Paul Moore wrote:
> On Tue, Jul 10, 2018 at 6:02 AM Jan Kara <jack(a)suse.cz> wrote:
> > Allocate fsnotify mark independently instead of embedding it inside
> > chunk. This will allow us to just replace chunk attached to mark when
> > growing / shrinking chunk instead of replacing mark attached to inode
> > which is a more complex operation.
> >
> > Signed-off-by: Jan Kara <jack(a)suse.cz>
> > ---
> > kernel/audit_tree.c | 59
++++++++++++++++++++++++++++++++++++++++-------------
> > 1 file changed, 45 insertions(+), 14 deletions(-)
>
> ...
>
> > diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
> > index bce3b04a365d..aec9b27a20ff 100644
> > --- a/kernel/audit_tree.c
> > +++ b/kernel/audit_tree.c
> > @@ -38,6 +38,11 @@ struct audit_chunk {
> > } owners[];
> > };
> >
> > +struct audit_tree_mark {
> > + struct fsnotify_mark fsn_mark;
> > + struct audit_chunk *chunk;
> > +};
>
> It's probably okay to just call it "mark" considering we call
> fsnotify_mark fields "mark" elsewhere. If we are going to change it
> in one spot we should probably change it other places as well for the
> sake of readability.
The current notation is that 'fsn_mark' (or sometimes 'entry') is struct
fsnotify_mark while plain 'mark' is struct audit_tree_mark (well, except
for audit_chunk AFAICS). So just replacing fsn_mark with mark is IMO going
to cause more confusion. But if you prefer different naming convention,
this is the right moment to bring some consistency into the whole thing.
So how do you prefer to differentiate between fsnotify_mark and
audit_tree_mark?
After searching the code and given your observation that audit_tree_mark is
rarely directly used, I guess I'll just make fsn_mark -> mark, entry->mark
renaming and invent some name for the few places where we use
audit_tree_mark directly.
Honza
--
Jan Kara <jack(a)suse.com>
SUSE Labs, CR