On Fri, Apr 01, 2005 at 11:23:52AM +1000, Nathan Scott wrote:
> Heh, you guys must have alot working if you're looking at EAs?
Alexander Kabaev (primary XFS/FreeBSD developer) just released a code snapshot
which can mount (read-only) XFS partitions in FreeBSD:
http://lists.freebsd.org/pipermail/freebsd-current/2005-March/047744.html
There is still a lot of work to do, of course.
In terms of documentation/code samples, the best source is
the extattr(2) and extattr(9) man pages:
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/sys/extattr_get_file.2
http://www.freebsd.org/cgi/cvsweb.cgi/src/share/man/man9/extattr.9
Basically I am trying to implement the following system call:
ssize_t extattr_list_file(const char *path, int attrnamespace, void *data,
size_t nbytes);
Currently on FreeBSD, for attrnamespace,
"user" attr namespace == 1
"system" attr namespace == 2
These are the only namespaces implemented so far, but could be
extended for other file systems
On Fri, Apr 01, 2005 at 11:35:31AM +1000, Tim Shimmin wrote:
> Hi Craig,
> From xfs_attr.h:
> #define ATTR_KERNOVAL 0x2000 /* [kernel] get attr size only, not value */
> #define ATTR_KERNAMELS 0x4000 /* [kernel] list attr names (simple list) */
>
> #define ATTR_KERNORMALS 0x0800 /* [kernel] normal attr list: user+secure */
> #define ATTR_KERNROOTLS 0x8000 /* [kernel] include root in the attr list */
> #define ATTR_KERNFULLS (ATTR_KERNORMALS|ATTR_KERNROOTLS)
>
> So back to the question.
> The linux interface of listing attributes will always list _all_ of
> the EAs for all the namespaces.
> The lower level xfs listing code (VOP_ATTR_LIST or xfs_attr_list)
> can handle listing of EAs for a particular namespace (by specifying
> the namespace bit in the passed in xflags).
>
> --Tim
Tim, thanks for your detailed response, it was VERY helpful.
So if I understand things correctly, if I take extattr_list_file()'s
attrnamespace flag, and map it to an ATTR_* flag for xfs_attr_list(),
I might be able to get things to work correctly. Any advice how
to do this? Something like:
attrnamespace = 1 (user) = xfs_attr_list() flag ATTR_KERNORMALS
attrnamespace = 2 (system) = xfs_attr_list() flag ATTR_KERNROOTLS
Hmmm...
Thanks.
--
Craig Rodrigues
rodrigc@xxxxxxxxxxxxxx
|