Re: [PATCH v14 05/12] KEYS: Move KEY_LOOKUP_ to include/linux/key.h and set KEY_LOOKUP_FLAGS_ALL

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

 



On Wed, Aug 31, 2022 at 08:33:38AM -0700, Alexei Starovoitov wrote:
> On Wed, Aug 31, 2022 at 2:24 AM Roberto Sassu
> <roberto.sassu@xxxxxxxxxxxxxxx> wrote:
> > > > >
> > > > > +#define KEY_LOOKUP_CREATE        0x01
> > > > > +#define KEY_LOOKUP_PARTIAL       0x02
> > > > > +#define KEY_LOOKUP_FLAGS_ALL     (KEY_LOOKUP_CREATE |
> > > > > KEY_LOOKUP_PARTIAL)
> > > >
> > > > IMHO this could be just KEY_LOOKUP_ALL.
> 
> Since this is supposed to be kernel internal flags
> please make them enum, so that bpf progs can auto-adjust
> (with the help of CORE) to changes in this enum.
> With #define there is no way for bpf prog to know
> when #define changed in the future kernels.

Isn't enum also Rust compatibility requirement, or do I remember
incorrectly? Anyway, good suggestion.

BR, Jarkko



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux