From owner-freebsd-fs@FreeBSD.ORG Sat Mar 22 20:00:32 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 043591065676 for ; Sat, 22 Mar 2008 20:00:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id BF92F8FC18 for ; Sat, 22 Mar 2008 20:00:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 29C7646B42; Sat, 22 Mar 2008 16:00:31 -0400 (EDT) Date: Sat, 22 Mar 2008 20:00:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= In-Reply-To: <47E55BC1.9080707@sh.cvut.cz> Message-ID: <20080322195758.K32322@fledge.watson.org> References: <47E43496.5080201@sh.cvut.cz> <20080322180253.B27442@fledge.watson.org> <47E55BC1.9080707@sh.cvut.cz> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="621616949-1646158922-1206216031=:32322" Cc: freebsd-fs@freebsd.org Subject: Re: Indication of extended attributes availability. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2008 20:00:32 -0000 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--