Re: [PATCH V2 02/10] xfs: Check for extent overflow when trivally adding a new extent

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

 



On Mon, Aug 17, 2020 at 01:14:16PM +0530, Chandan Babu R wrote:
> > > +		error = xfs_iext_count_may_overflow(ip, whichfork,
> > > +				XFS_IEXT_ADD_CNT);
> > 
> > I find the XFS_IEXT_ADD_CNT define very confusing.  An explicit 1 passed
> > for a counter parameter makes a lot more sense to me.
> 
> The reason to do this was to consolidate the comment descriptions at one
> place. For e.g. the comment for XFS_IEXT_DIR_MANIP_CNT (from "[PATCH V2 05/10]
> xfs: Check for extent overflow when adding/removing dir entries") is slightly
> larger. Using constants (instead of macros) would mean that the same comment
> has to be replicated across the 6 locations it is being used.

I agree with a constant if we have a complex computed value.  But a
constant for 1 where it is obvious from the context that one means
the number one as in adding a single items is just silly and really
hurts when reading the code.

> 
> -- 
> chandan
> 
> 
> 
---end quoted text---



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux