Indication of extended attributes availability.
Václav Haisman
v.haisman at sh.cvut.cz
Sat Mar 22 19:41:50 UTC 2008
Robert Watson wrote, On 22.3.2008 19:05:
>
> On Fri, 21 Mar 2008, Václav Haisman wrote:
>
>> I would like to have some sort of indication of extended attributes
>> availability for given FS. It seems that things like this (MAC, ACLs
>> etc.) are indicated using mount flags and those are available through
>> statfs() call. The following is tentative patch that would expose
>> extended attributes availability as mount flag. It is completely
>> untested. I would just like to know if it is a viable approach to the
>> problem or should I scratch it and try something else?
>
> I think the preferred programmatic approach is actually via
> fpathconf(2). I don't know if any other OS's have assigned a _PC
> constant for extended attributes, but if they have we should probably
> use the same one. However, I guess there's a meta-question: is your
> goal to allow programs to be able to tell if extended attributes are
> available, or for administrators to be able to tell?
>
My original intent was to just extend /bin/cp with switch that would allow
copying of extended attributes together with the contents of files. When I
looked at its source I noticed that it uses fpathconf() for querying for ACLs
capability. Because I have not found extended attributes in fpathconf(2) I
have looked at statfs(2) but there is nothing there either. So I thought the
information would have to be conveyed to either of the syscalls somehow. The
mnt_flag field of struct mount seems like a logical place to put the
information into. From there it seems it could be used by either fpathconf()
or statfs() or both.
So, to answer the question, the goal is to allow programs to detect extended
attributes availability.
As to what other OSes do, Solaris mentions _PC_XATTR_ENABLED and
_PC_XATTR_EXISTS in fpathconf(2).
--
VH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20080322/1b038efc/signature.pgp
More information about the freebsd-fs
mailing list