Re: [PATCH v1 0/5] io_uring: add xattr support

Dave Chinner
2021-11-30T07:52:32Z

On Mon, Nov 29, 2021 at 08:16:02PM -0700, Andreas Dilger wrote:
>
> > On Nov 29, 2021, at 6:08 PM, Clay Harris <bugs@claycon.org> wrote:
> >
> > On Mon, Nov 29 2021 at 14:12:52 -0800, Stefan Roesch quoth thus:
> >
> >> This adds the xattr support to io_uring. The intent is to have a more
> >> complete support for file operations in io_uring.
> >>
> >> This change adds support for the following functions to io_uring:
> >> - fgetxattr
> >> - fsetxattr
> >> - getxattr
> >> - setxattr
> >
> > You may wish to consider the following.
> >
> > Patching for these functions makes for an excellent opportunity
> > to provide a better interface. Rather than implement fXetattr
> > at all, you could enable io_uring to use functions like:
> >
> > int Xetxattr(int dfd, const char *path, const char *name,
> > [const] void *value, size_t size, int flags);
>
> This would naturally be named "...xattrat()"?
>
> > Not only does this simplify the io_uring interface down to two
> > functions, but modernizes and fixes a deficit in usability.
> > In terms of io_uring, this is just changing internal interfaces.
>
> Even better would be the ability to get/set an array of xattrs in
> one call, to avoid repeated path lookups in the common case of
> handling multiple xattrs on a single file.

Been around for since the mid 1990s IIRC. XFS brought them to Linux
from Irix and they are used by xfsdump/restore via libhandle. API
documented here:

$ man 3 attr_multi

And they are implemented through XFS ioctls.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com