[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221121232010.GN3600936@dread.disaster.area>
Date: Tue, 22 Nov 2022 10:20:10 +1100
From: Dave Chinner <david@...morbit.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: Catherine Hoang <catherine.hoang@...cle.com>,
linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH v2 2/2] xfs: add FS_IOC_GETFSUUID ioctl
On Mon, Nov 21, 2022 at 02:18:47PM -0800, Darrick J. Wong wrote:
> On Tue, Nov 22, 2022 at 08:02:23AM +1100, Dave Chinner wrote:
> > On Fri, Nov 18, 2022 at 01:14:08PM -0800, Catherine Hoang wrote:
> > i.e.
> > if (fsuuid.fsu_flags != 0)
> > return -EINVAL;
> >
> > error = xfs_fs_get_uuid(&mp->m_sb, uuid, &fsuuid.fsu_len, NULL);
> > if (error)
> > return -EINVAL;
> >
> > Also, uuid_copy()?
>
> Why does xfs_fs_get_uuid use memcpy then? Did the compiler reject the
> u8* -> uuid_t * type conversion?
No idea, I've completely forgotten about the reasons for the code
being written that way.
These days people seem to care about making the compiler do all the
type checking and type conversions for us. The use of UUIDs and
various types within XFS has been quite ad hoc, so I'm just
suggesting that we improve it somewhat.
Using types and APIs that mean we don't have to code the length of
UUIDs everywhere seems like a Good Idea for newly written code...
> Alternately there's export_uuid().
But we don't need that if we use uuid_t for all the local
representations of the UUID....
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists