Re: [PATCH 06/13] fs: Drop unnecessary underscore from _SB_I_ constants

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

 



On Thu, Aug 08, 2024 at 07:35:05AM GMT, Darrick J. Wong wrote:
> On Thu, Aug 08, 2024 at 01:47:20PM +0200, Amir Goldstein wrote:
> > On Wed, Aug 7, 2024 at 8:31 PM Jan Kara <jack@xxxxxxx> wrote:
> > >
> > > Now that old constants are gone, remove the unnecessary underscore from
> > > the new _SB_I_ constants. Pure mechanical replacement, no functional
> > > changes.
> > >
> > 
> > This is a potential backporting bomb.
> > It is true that code using the old constant names with new macros
> > will not build on stable kernels, but I think this is still asking for trouble.
> > 
> > Also, it is a bit strange that SB_* flags are bit masks and SB_I_*
> > flags are bit numbers.
> > How about leaving the underscore and using  sb_*_iflag() macros to add
> > the underscore?
> 
> Or append _BIT to the new names, as is sometimes done elsewhere in the
> kernel?
> 
> #define SB_I_VERSION_BIT	23

Yeah, that's better (Fwiw, SB_I_VERSION is confusingly not an
sb->i_flags. I complained about this when it was added.).

I don't want to end up with the same confusion that we have for
__I_NEW/I_NEW and __I_SYNC/I_SYNC which trips me up every so often when
I read that code.

So t probably wouldn't be the worst if we had:

#define SB_I_NODEV_BIT 3
#define SB_I_NODEV BIT(SB_I_NODEV_BIT)

so filesystems that raise that flag when they're initialized can do:

sb->i_flags |= SB_I_NODEV;

and not pointlessly make them do:

sb->i_flags |= 1 << SB_I_NODEV_BIT;




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

  Powered by Linux