[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <173CAB23-6A80-44CE-AC8C-4A37E6625BFE@dilger.ca>
Date: Sun, 15 Mar 2020 18:11:19 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: "Theodore Y. Ts'o" <tytso@....edu>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 7/7] tune2fs: Update dir checksums when clearing dir_index
feature
On Mar 15, 2020, at 11:15 AM, Theodore Y. Ts'o <tytso@....edu> wrote:
>
> With regards to the enum, I agree with Jan that using an enum for
> bitfields isn't a great fit. Also, in this case, where it's for a
> static function and the definitions don't go beyond a single file, the
> advantages of using an enum so we can have strong typing is much less
> useful.
I don't think that "enum" has to mean "sequential integers", but rather
"an listing of related constants" as defined by Wikipedia:
An enumeration is a complete, ordered listing of all
the items in a collection.
Giving a list of related constants a name makes the code easier to
understand, especially when the variables have totally generic names
like "flags". I'm not saying it isn't possible to figure out what
the possible values of that variable are, by hunting around the code
to see what is assigned to it, but making the code easier to understand
at first reading should have value by itself?
Cheers, Andreas
Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)
Powered by blists - more mailing lists