[PATCH v2 05/17] xfs: create macros/helpers for dealing with sparse inode chunks
Fanael Linithien
fanael4 at gmail.com
Mon Nov 3 17:56:17 CST 2014
2014-11-03 23:34 GMT+01:00 Brian Foster <bfoster at redhat.com>:
> On Mon, Nov 03, 2014 at 11:12:12PM +0100, Fanael Linithien wrote:
>> 2014-11-03 17:12 GMT+01:00 Brian Foster <bfoster at redhat.com>:
>> >
>> > +static inline bool xfs_inobt_issparse(uint16_t holemask)
>> > +{
>> > + return holemask == 0 ? false : true;
>> > +}
>>
>> Surely that should be "return holemask != 0;"?
>>
>
> ir_holemask bits are set for holes in the inode chunk and unset for
> allocated regions. This means that ir_holemask == 0 for a normal,
> fully-allocated chunk and != 0 otherwise (some bits are set to indicate
> the chunk has a hole). Check out the commit log for patch 4 for
> reasoning.
Oh, I don't comment on the logic, as I don't really know much about
XFS code. It's purely a stylistic suggestion: "holemask == 0 ? false :
true" looks entirely equivalent to "holemask != 0".
More information about the xfs
mailing list