On Wed, Jul 12, 2023 at 10:44:50PM -0700, Darrick J. Wong wrote: > /* > * List the names and sizes of the values of all the attributes of an object. > * "Cursor" must be allocated and zeroed before the first call, it is used > * to maintain context between system calls if all the attribute names won't > * fit into the buffer on the first system call. > * The return value is -1 on error (w/errno set appropriately), 0 on success. > */ > extern int attr_list(const char *__path, char *__buffer, const int __buffersize, > int __flags, attrlist_cursor_t *__cursor) > __attribute__ ((deprecated ("Use listxattr or llistxattr instead"))); > extern int attr_listf(int __fd, char *__buffer, const int __buffersize, > int __flags, attrlist_cursor_t *__cursor) > __attribute__ ((deprecated ("Use flistxattr instead"))); > > I take that as a sign that they could drop all these xfs-specific APIs > one day, which means we ought to keep them in xfs_fs.h. Well... These APIs you quoted are in fact internally mapped to the normal xattr syscalls by libattr, and have been since the Linux xattr syscalls were created. The only thing that actually uses the definitions in Linux is the magic attrlist by handle ioctl that exists only in XFS and which is exported through libhandle in xfsprogs. But the libhandle API is based on the attrlist_cursor from libattr and doesn't use the xfs_ kernel definitions. (that struct attrlist/attrlist_ent in libattr have the same 1-sized array problem, but fortunately we don't need to solve that here..)