Re: [PATCH v3 05/13] fanotify: classify events that hold a file identifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 28, 2018 at 5:44 PM Jan Kara <jack@xxxxxxx> wrote:
>
> Sorry, sent previous reply too early.
>
> On Wed 28-11-18 16:33:12, Jan Kara wrote:
> > @@ -38,6 +50,21 @@ struct fanotify_event {
> >       struct pid *pid;
> >  };
> >
> > +/*
> > + * Bit 0 of info.flags is set when event has fid information.
> > + * event->info shares the same union address with event->path, so this helps
> > + * us tell if event has fid or path.
> > + */
> > +#define __FANOTIFY_FID               1UL
> > +#define FANOTIFY_HAS_FID(event)      ((event)->info.flags & __FANOTIFY_FID)
>
> Why isn't this an inline function? And then the name wouldn't have to be
> all caps...

Sure.

>
> Also I'd prefer if we just enlarged struct fanotify_event by 8 bytes to
> allow simple 'flags' field and info about possible embedded fid, rather
> than playing these bit tricks. They save space but make code more subtle
> and I don't file struct fanotify_event size so critical.
>

Ok.

Freeing the space of path.dentry and path.mnt will give us 16 bytes of space
for embedded fid, which should be sufficient for many file handles (ext4, xfs).
and flags could indicate if fid is embedded or allocated.

Thanks,
Amir.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux