On Sat, Jun 01, 2002 at 12:53:51PM +1000, Nathan Scott wrote:
> On Fri, May 31, 2002 at 01:20:23PM -0700, Anmar Oueja wrote:
> > What's the best way of efficiently retrieving all extended attributes of
> > a file on an XFS partition?
> > Now I'm doing what the utility getattr does:
> There is another solution as well, as Steve has pointed out - xfsdump
> uses some XFS-specific ioctl's to get back multiple attribute values
> at once. Such a program would only work on XFS filesystems though,
> where as getfattr will work for all filesystems supporting EAs.
On IRIX and old linux-xfs, a low syscall count solution for
what you want is attr_multi (and attr_list).
It would for instance, allow you to get all the values for a list of names
in 2 syscalls.
However, with the syscall reorg, attr_multi is now done as
xfsdump uses jdm_attr_list and jdm_attr_multi (these have been retained).
jdm_attr_list is used to get the list of names and valuelen's
to put into a multi struct, and jdm_attr_multi is used to
get all the values in one syscall.
These are done as single ioctls so retain the efficiency.
I'm not so famiiliar with the jdm_*() calls, but I
think one would need to call jdm_getfshandle(mntpt)
to get an fshandle, and one also needs an xfs_bstat_t
(for an ino#/gen#) which one normally gets from
a bulkstat ioctl (XFS_IOC_FSBULKSTAT, XFS_IOC_FSBULKSTAT_SINGLE).