Re: [PATCH v2 1/3] uuid: Add inline helpers to operate on raw buffers

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

 



On Wed, Jul 17, 2019 at 05:37:06PM +0200, David Sterba wrote:
> On Tue, Jul 16, 2019 at 06:22:22PM +0300, Andy Shevchenko wrote:
> > On Tue, Jul 16, 2019 at 05:11:33PM +0200, Christoph Hellwig wrote:
> > > On Tue, Jul 16, 2019 at 06:04:16PM +0300, Andy Shevchenko wrote:

> > > I hate this raw naming.  If people really want to use the generators on
> > > u8 fields a cast seems more descriptive then hiding it.
> > 
> > This entire patch because of BTRFS maintainers, they didn't want the explicit
> > casts. Maybe something has been changed, I dunno.
> 
> No change on our side. The uuids are u8 in the on-disk structures, that
> will stay. The uuid functions use a different type so the casts have to
> be added, that's clear. The question is if it's up to the API to provide
> functions that take u8, or btrfs code to put typecasts everywhere or
> carry own wrappers that do that.
> 
> I tend to avoid the explicit typecasts for widely used functions because
> it's easy to forget them, and it overrides the type checks (that could
> be caught by compiler but also not).
> 
> Specifically for uuid, the endianness might matter, so that we use the
> raw buffers makes things more explicit.

Thank you for the information.

Can you review v3 of the series where I attempted to satisfy everybody, Chris
in his wish to not do ugly raw generators and Btrfs by providing minimum needed
API helpers?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux