Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Mar 2008 20:00:31 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= <v.haisman@sh.cvut.cz>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Indication of extended attributes availability.
Message-ID:  <20080322195758.K32322@fledge.watson.org>
In-Reply-To: <47E55BC1.9080707@sh.cvut.cz>
References:  <47E43496.5080201@sh.cvut.cz> <20080322180253.B27442@fledge.watson.org> <47E55BC1.9080707@sh.cvut.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--621616949-1646158922-1206216031=:32322
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE


On Sat, 22 Mar 2008, V=E1clav Haisman wrote:

>> I think the preferred programmatic approach is actually via fpathconf(2)=
=2E I=20
>> don't know if any other OS's have assigned a _PC constant for extended=
=20
>> attributes, but if they have we should probably use the same one.=20
>> However, I guess there's a meta-question: is your goal to allow programs=
 to=20
>> be able to tell if extended attributes are available, or for administrat=
ors=20
>> to be able to tell?
>
> My original intent was to just extend /bin/cp with switch that would allo=
w=20
> copying of extended attributes together with the contents of files. When =
I=20
> looked at its source I noticed that it uses fpathconf() for querying for=
=20
> ACLs capability. Because I have not found extended attributes in=20
> fpathconf(2) I have looked at statfs(2) but there is nothing there either=
=2E=20
> So I thought the information would have to be conveyed to either of the=
=20
> syscalls somehow. The mnt_flag field of struct mount seems like a logical=
=20
> place to put the information into. From there it seems it could be used b=
y=20
> either fpathconf() or statfs() or both.
>
> So, to answer the question, the goal is to allow programs to detect exten=
ded=20
> attributes availability.
>
> As to what other OSes do, Solaris mentions _PC_XATTR_ENABLED and=20
> _PC_XATTR_EXISTS in fpathconf(2).

mount flags are normally used for places where there is a desire to report =
an=20
administrative setting, and on the whole, extended attributes are a propert=
y=20
of the file system type, and not a per-mount setting.  UFS1 extended=20
attributes are intended to be the exception rather than the rule.  The way=
=20
fpathconf() works inside the kernel is that the request is delivered direct=
ly=20
to the file system that implements the target of the path provided, so it c=
an=20
return information on whatever granularity it wants -- be it per-mount,=20
per-volume, etc.  I think the Solaris model sounds pretty sensible, althoug=
h=20
one thing worth considering is that Solari's extended attributes may, in fa=
ct,=20
be file forks or streams, and called extended attributes due to NFSv4 using=
=20
that terminology (an unfortunate overloading inconsistent with the use in m=
any=20
OS's).  In which case we might want to use a different name.  It would be=
=20
worth checking Linux and Mac OS X as well.

Robert N M Watson
Computer Laboratory
University of Cambridge
--621616949-1646158922-1206216031=:32322--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080322195758.K32322>