Re: [PATCH 1/6] xfs: create a blob array data structure

Darrick J. Wong
2024-01-06T01:33:17Z

On Thu, Jan 04, 2024 at 09:53:33PM -0800, Christoph Hellwig wrote:
> On Sun, Dec 31, 2023 at 12:35:11PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Create a simple 'blob array' data structure for storage of arbitrarily
> > sized metadata objects that will be used to reconstruct metadata. For
> > the intended usage (temporarily storing extended attribute names and
> > values) we only have to support storing objects and retrieving them.
> > Use the xfile abstraction to store the attribute information in memory
> > that can be swapped out.
>
> Can't this simply be supported by xfiles directly? Just add a
> xfile_append that writes at i_size and retuns the offset and we're done?

Yeah, xfile could just do an "append and tell me where you wrote it".
That said, i_size_read is less direct than reading a u64 out of a
struct.

Another speedbump with doing that is that eventually xfs_repair ports
the xfblob to userspace to support parent pointers. For that, a statx
call is much more expensive, so I decided that both implementations
should just have their own private u64 write pointer.

(Unless you want to sponsor a pwrite variant that actually does "append
and tell me where"? ;))

--D