tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: extended attributes and lsextattr/extattr_list_file

On Wed, Jun 29, 2011 at 09:31:33AM +0000, Emmanuel Dreyfus wrote:
 > The conversion is easy to do, but the right place to do it is
 > tricky.  VOP_LISTEXTATTR() writes its output to the userland
 > buffer, therefore if I convert in src/sys/ufs/ufs/ufs_extattr.c, I
 > have to copyin/convert/copyout, and that does not looks good
 > perfromance-wise.

That would be totally wrong anyway; if this becomes necessary, teach
the filesystems that have extended attributes (which is only ffs,
right?) to issue the data by uiomove, which they should have been
doing anyway, and then they can dump to a kernel or user buffer as
needed transparently.

 > Converting in libc is another option,

That is by far the sanest way to do it.

 > and we can also add a flavor flag to VOP_LISTEXTATTR so that we can
 > require the filesystem to output the data in the appropriate
 > format.

Please don't.

That said, even if you don't like the suggestion of using struct
dirent, ISTM that the preferred user API for listing extended
attributes should be something more like opendir/readdir.

David A. Holland

Home | Main Index | Thread Index | Old Index