lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250822143641.GW22430@twin.jikos.cz>
Date: Fri, 22 Aug 2025 16:36:41 +0200
From: David Sterba <dsterba@...e.cz>
To: Christian Brauner <brauner@...nel.org>
Cc: Josef Bacik <josef@...icpanda.com>, linux-fsdevel@...r.kernel.org,
	linux-btrfs@...r.kernel.org, kernel-team@...com,
	linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
	viro@...iv.linux.org.uk
Subject: Re: [PATCH 02/50] fs: make the i_state flags an enum

On Fri, Aug 22, 2025 at 01:08:07PM +0200, Christian Brauner wrote:
> On Thu, Aug 21, 2025 at 04:18:13PM -0400, Josef Bacik wrote:
> > +/*
> > + * As simple macro to define the inode state bits, __NAME will be the bit value
> > + * (0, 1, 2, ...), and NAME will be the bit mask (1U << __NAME). The __NAME_SEQ
> > + * is used to reset the sequence number so the next name gets the next bit value
> > + * in the sequence.
> > + */
> > +#define INODE_BIT(name)			\
> > +	__ ## name,			\
> > +	name = (1U << __ ## name),	\
> > +	__ ## name ## _SEQ = __ ## name
> 
> I'm not sure if this is the future we want :D
> I think it's harder to parse than what we have now.

If it would be a generic sounding name like ENUM_BIT

https://elixir.bootlin.com/linux/v6.16.2/source/fs/btrfs/misc.h#L16

one does not have to parse anything and the meaning is understandable in
the context of enum. We've converted everything to that in btrfs and
it's convenient to change just one line when adding or removing entries,
not caring about the exact values.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ