Re: [PATCH v2 11/16] fanotify: prepare to encode both parent and child fid's

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

 



On Thu, Feb 27, 2020 at 3:30 PM Jan Kara <jack@xxxxxxx> wrote:
>
> On Thu 27-02-20 14:12:30, Amir Goldstein wrote:
> > >
> > > > struct fanotify_fh_name {
> > > >          union {
> > > >                 struct {
> > > >                        u8 fh_type;
> > > >                        u8 fh_len;
> > > >                        u8 name_len;
> > > >                        u32 hash;
> > > >                 };
> > > >                 u64 hash_len;
> > > >         };
> > > >         union {
> > > >                 unsigned char fh[FANOTIFY_INLINE_FH_LEN];
> > > >                 unsigned char *ext_fh;
> > > >         };
> > > >         char name[0];
> > > > };
> > >
> > > So based on the above I wouldn't add just name hash to fanotify_fh_name at
> > > this point...
> > >
> >
> > OK. but what do you think about tying name with fh as above?
> > At least name_len gets to use the hole this way.
>
> Is saving that one byte for name_len really worth the packing? If anything,
> I'd rather do the fanotity_fh padding optimization I outlined in another
> email. That would save one long without any packing and the following u8
> name_len would get packed tightly after the fanotify_fh by the compiler.
>

OK. I will try that and the non-inherited variant of perm/name event struct
and see how it looks like.

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