Date: Sat, 22 Mar 2008 20:19:29 +0100 From: =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= <v.haisman@sh.cvut.cz> To: Robert Watson <rwatson@FreeBSD.org> Cc: freebsd-fs@freebsd.org Subject: Re: Indication of extended attributes availability. Message-ID: <47E55BC1.9080707@sh.cvut.cz> In-Reply-To: <20080322180253.B27442@fledge.watson.org> References: <47E43496.5080201@sh.cvut.cz> <20080322180253.B27442@fledge.watson.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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 [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH5VvIoUFWwtEPkHIRCACQAJ9fbZi+VN0qAEAhTKcNqiEFcaP/MACfdNXf wBW21UqyQWN0aPGr5yhEfPU= =75tu -----END PGP SIGNATURE-----help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47E55BC1.9080707>
