From owner-freebsd-fs@FreeBSD.ORG Sun Feb 26 17:06:29 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90AA216A420 for ; Sun, 26 Feb 2006 17:06:29 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50DFD43D6E for ; Sun, 26 Feb 2006 17:06:27 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k1QH6OZZ033087; Sun, 26 Feb 2006 10:06:24 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <4401E010.7070804@samsco.org> Date: Sun, 26 Feb 2006 10:06:24 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Wei Lei References: <36fee7420602250625h7271d694i7bfc9e69eda8ade7@mail.gmail.com> In-Reply-To: <36fee7420602250625h7271d694i7bfc9e69eda8ade7@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org Cc: freebsd-fs@freebsd.org, Manish Rai Jain Subject: Re: Doubt about ntfs code: lockmgr with LK_INTERLOCK flag 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: Sun, 26 Feb 2006 17:06:29 -0000 Wei Lei wrote: > Hi list, > > Nice to be here =) > > I am new here so just hope my first post doesn't mismatch the topic. > > I have a doubt when understanding the ntfs code with freebsd 5.4: > ntfs_subr.c, function ntfs_ntget(). > I understand that lockmgr() here is trying to get an exclusive lock and > release the mutex ip->i_interlock, > so that the protection can expand from use_count to the whole ntnode. > > But what's the significance of having such a mechanism? What could possibly > happen if I do a > mtx_unlock first then acquire the exclusive lock? > Doing a mtx_unlock() could trigger your thread to get preempted by a higher priority thread that could then come in and modify the i_usecount field. Scott From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 17:48:19 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6AA116A422 for ; Wed, 1 Mar 2006 17:48:19 +0000 (GMT) (envelope-from mday@apple.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D0A443D46 for ; Wed, 1 Mar 2006 17:48:19 +0000 (GMT) (envelope-from mday@apple.com) Received: from relay7.apple.com (a17-128-113-37.apple.com [17.128.113.37]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k21HmJ8n014606 for ; Wed, 1 Mar 2006 09:48:19 -0800 (PST) Received: from [17.202.43.217] (doomsday.apple.com [17.202.43.217]) by relay7.apple.com (Apple SCV relay) with ESMTP id E579F19F for ; Wed, 1 Mar 2006 09:48:18 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v749) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-fs@freebsd.org From: Mark Day Date: Wed, 1 Mar 2006 09:48:04 -0800 X-Mailer: Apple Mail (2.749) X-Brightmail-Tracker: AAAAAA== Subject: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 17:48:19 -0000 Hello, For an future version of Mac OS X, I'm trying to solve a problem where certain files and directories on Windows file systems don't normally appear in the Windows GUI, but currently do appear in the Mac OS X GUI (but they shouldn't). I'd like to gauge interest in having the change ported back to FreeBSD (since many of our file systems are derived from FreeBSD). The approach I'm planning to use is to add a new flag to the file flags (i.e. the st_flags field from stat(2); settable via chflags(2)). I'd like to avoid a collision with any flags FreeBSD would add in the future, so either have FreeBSD adopt the flag, or start allocating Mac OS X-specific flags from the high order bits (since FreeBSD has been allocating them from the low order bits). My current name for this new file flag is UF_HIDDEN. Windows file systems (FAT, NTFS, SMB) have a "hidden" attribute bit on files and directories. If a file or directory has this attribute set, Windows will not normally show it in the GUI unless you explicit ask to view hidden items. Mac file systems (HFS, AFP) have a similar notion called the "invisible" bit, which is just one part of the Finder Info (which also contains things like file type and creator information, icon position, etc.). Mac OS X has a mechanism for storing Finder Info on file systems without native support for Finder Info, by using extra files known as AppleDouble or "dot underscore" files (because their name is the original file's name with "._" prepended). The management of the AppleDouble files happens in application-layer libraries in Mac OS X 10.3.x and earlier, and also in the VFS layer in Mac OS X 10.4.x and later. It would be complex to try to push the AppleDouble support down into the Windows file systems merely so they could shadow their native hidden bit into the invisible bit of the Finder Info. The file flags are very easy for individual file systems to implement. And the GUI is already getting the stat(2) information anyway, so no need to make extra system calls. I could certainly provide patches to FreeBSD for the headers, FAT, NTFS, and probably HFS. The strtofflags(3) and fflagstostr(3) functions should also change so you can get at the flag bit via ls (1), find(1), chflags(1), etc.; I think I could provide that patch, too. (I've never actually used FreeBSD, so it will take me a bit of time to get it installed, find my way around the sources, make and test the changes.) -Mark From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 18:18:15 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EC9316A423 for ; Wed, 1 Mar 2006 18:18:15 +0000 (GMT) (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 7805143D58 for ; Wed, 1 Mar 2006 18:18:14 +0000 (GMT) (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 15B3C46C0F; Wed, 1 Mar 2006 13:17:54 -0500 (EST) Date: Wed, 1 Mar 2006 18:22:39 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mark Day In-Reply-To: Message-ID: <20060301182001.W40707@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 18:18:15 -0000 On Wed, 1 Mar 2006, Mark Day wrote: > I could certainly provide patches to FreeBSD for the headers, FAT, NTFS, and > probably HFS. The strtofflags(3) and fflagstostr(3) functions should also > change so you can get at the flag bit via ls(1), find(1), chflags(1), etc.; > I think I could provide that patch, too. (I've never actually used FreeBSD, > so it will take me a bit of time to get it installed, find my way around the > sources, make and test the changes.) I don't see any problem with this. The only flag I know of in FreeBSD that might not appear in Mac OS X is the system snapshot flag, which was added to UFS after Apple forked from the FreeBSD source. You can find current flag allocation here: http://fxr.watson.org/fxr/source/sys/stat.h 274 /* 275 * Definitions of flags stored in file flags word. 276 * 277 * Super-user and owner changeable flags. 278 */ 279 #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ 280 #define UF_NODUMP 0x00000001 /* do not dump file */ 281 #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ 282 #define UF_APPEND 0x00000004 /* writes to file may only append */ 283 #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ 284 #define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ 285 /* 286 * Super-user changeable flags. 287 */ 288 #define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */ 289 #define SF_ARCHIVED 0x00010000 /* file is archived */ 290 #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ 291 #define SF_APPEND 0x00040000 /* writes to file may only append */ 292 #define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */ 293 #define SF_SNAPSHOT 0x00200000 /* snapshot inode */ We have talked about adding a flag to hint the presence of extended ACL data also, so that applications know if they should rely solely on stat() for protection information, or also call acl_get_{fd,file,link}() to receive extended ACL data for ls(1) output. Is your plan to mask hidden files solely in user space, or to look at masking it in kernel also? Robert N M Watson From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 18:20:54 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F56516A420 for ; Wed, 1 Mar 2006 18:20:54 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0D5F43D48 for ; Wed, 1 Mar 2006 18:20:53 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k21IKnCJ035933; Wed, 1 Mar 2006 12:20:49 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <4405E601.7010304@centtech.com> Date: Wed, 01 Mar 2006 12:20:49 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: Mark Day References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1308/Wed Mar 1 04:13:39 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 18:20:54 -0000 Mark Day wrote: > Hello, > > For an future version of Mac OS X, I'm trying to solve a problem where > certain files and directories on Windows file systems don't normally > appear in the Windows GUI, but currently do appear in the Mac OS X GUI > (but they shouldn't). I'd like to gauge interest in having the change > ported back to FreeBSD (since many of our file systems are derived > from FreeBSD). The approach I'm planning to use is to add a new flag > to the file flags (i.e. the st_flags field from stat(2); settable via > chflags(2)). I'd like to avoid a collision with any flags FreeBSD > would add in the future, so either have FreeBSD adopt the flag, or > start allocating Mac OS X-specific flags from the high order bits > (since FreeBSD has been allocating them from the low order bits). My > current name for this new file flag is UF_HIDDEN. [..snip..] > I could certainly provide patches to FreeBSD for the headers, FAT, > NTFS, and probably HFS. The strtofflags(3) and fflagstostr(3) > functions should also change so you can get at the flag bit via ls(1), > find(1), chflags(1), etc.; I think I could provide that patch, too. > (I've never actually used FreeBSD, so it will take me a bit of time to > get it installed, find my way around the sources, make and test the > changes.) > Wow - about a week ago, I started looking into this same feature for FreeBSD, because I'd like to hide directories and files for UFS2 snapshots. I came to nearly the same conclusion, using chflags, etc, and even the name for the flag. :) Anyhow, this is obviously a feature that would be useful to many people, however don't be discouraged if you get little response about it. It's a 'if you built, they will come' kind of feature anyhow. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------ From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 18:32:54 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C830716A420; Wed, 1 Mar 2006 18:32:54 +0000 (GMT) (envelope-from mday@apple.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAFE643D64; Wed, 1 Mar 2006 18:32:52 +0000 (GMT) (envelope-from mday@apple.com) Received: from relay6.apple.com (a17-128-113-36.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k21IWqNb023021; Wed, 1 Mar 2006 10:32:52 -0800 (PST) Received: from [17.202.43.217] (doomsday.apple.com [17.202.43.217]) by relay6.apple.com (Apple SCV relay) with ESMTP id 54BD928D; Wed, 1 Mar 2006 10:32:52 -0800 (PST) In-Reply-To: <20060301182001.W40707@fledge.watson.org> References: <20060301182001.W40707@fledge.watson.org> Mime-Version: 1.0 (Apple Message framework v749) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5D13DC0E-0ABB-4A3C-B760-18BC2E978DB0@apple.com> Content-Transfer-Encoding: 7bit From: Mark Day Date: Wed, 1 Mar 2006 10:32:37 -0800 To: Robert Watson X-Mailer: Apple Mail (2.749) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-fs@FreeBSD.org Subject: Re: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 18:32:54 -0000 On Mar 1, 2006, at 10:22 AM, Robert Watson wrote: > I don't see any problem with this. The only flag I know of in > FreeBSD that might not appear in Mac OS X is the system snapshot > flag, which was added to UFS after Apple forked from the FreeBSD > source. Mac OS X is missing both the NOUNLINK and the SNAPSHOT flags. Since Mac OS X doesn't implement the functionality corresponding to either bit, my plan was to leave those #defines commented out in the Mac OS X headers, with a comment indicating we don't implement that functionality. I'm a little concerned that an app might see those bits defined, try to use the functionality, and be surprised when it doesn't work as expected. > We have talked about adding a flag to hint the presence of extended > ACL data also, so that applications know if they should rely solely > on stat() for protection information, or also call acl_get_ > {fd,file,link}() to receive extended ACL data for ls(1) output. Is > your plan to mask hidden files solely in user space, or to look at > masking it in kernel also? I knew I'd forgotten to mention something. The plan is that this bit is purely a hint to user space. It's up to the application (especially a GUI) to decide whether to show a hidden file to the user or not. -Mark From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 18:42:55 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E141816A420 for ; Wed, 1 Mar 2006 18:42:55 +0000 (GMT) (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 4BA2443D45 for ; Wed, 1 Mar 2006 18:42:55 +0000 (GMT) (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 7529546BB1; Wed, 1 Mar 2006 13:42:19 -0500 (EST) Date: Wed, 1 Mar 2006 18:47:05 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mark Day In-Reply-To: <5D13DC0E-0ABB-4A3C-B760-18BC2E978DB0@apple.com> Message-ID: <20060301184602.N40707@fledge.watson.org> References: <20060301182001.W40707@fledge.watson.org> <5D13DC0E-0ABB-4A3C-B760-18BC2E978DB0@apple.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@FreeBSD.org Subject: Re: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 18:42:56 -0000 On Wed, 1 Mar 2006, Mark Day wrote: > On Mar 1, 2006, at 10:22 AM, Robert Watson wrote: > >> I don't see any problem with this. The only flag I know of in FreeBSD that >> might not appear in Mac OS X is the system snapshot flag, which was added >> to UFS after Apple forked from the FreeBSD source. > > Mac OS X is missing both the NOUNLINK and the SNAPSHOT flags. > > Since Mac OS X doesn't implement the functionality corresponding to either > bit, my plan was to leave those #defines commented out in the Mac OS X > headers, with a comment indicating we don't implement that functionality. > I'm a little concerned that an app might see those bits defined, try to use > the functionality, and be surprised when it doesn't work as expected. Sounds good -- as long as they are marked as reserved values in Mac OS X, that should (hopefully) prevent later collisions. >> We have talked about adding a flag to hint the presence of extended ACL >> data also, so that applications know if they should rely solely on stat() >> for protection information, or also call acl_get_{fd,file,link}() to >> receive extended ACL data for ls(1) output. Is your plan to mask hidden >> files solely in user space, or to look at masking it in kernel also? > > I knew I'd forgotten to mention something. The plan is that this bit is > purely a hint to user space. It's up to the application (especially a GUI) > to decide whether to show a hidden file to the user or not. Sounds good. Do you plan to implement a hidden flag only in the user flag range, or also a system hidden flag? Robert N M Watson From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 20:25:05 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 571A816A420; Wed, 1 Mar 2006 20:25:05 +0000 (GMT) (envelope-from mday@apple.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1492143D45; Wed, 1 Mar 2006 20:25:05 +0000 (GMT) (envelope-from mday@apple.com) Received: from relay7.apple.com (a17-128-113-37.apple.com [17.128.113.37]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id k21KP4Mw000108; Wed, 1 Mar 2006 12:25:04 -0800 (PST) Received: from [17.202.43.217] (doomsday.apple.com [17.202.43.217]) by relay7.apple.com (Apple SCV relay) with ESMTP id C6DF519C; Wed, 1 Mar 2006 12:25:04 -0800 (PST) In-Reply-To: <20060301184602.N40707@fledge.watson.org> References: <20060301182001.W40707@fledge.watson.org> <5D13DC0E-0ABB-4A3C-B760-18BC2E978DB0@apple.com> <20060301184602.N40707@fledge.watson.org> Mime-Version: 1.0 (Apple Message framework v749) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3CABEB63-FFC3-42DC-97F1-FE79ADA96B66@apple.com> Content-Transfer-Encoding: 7bit From: Mark Day Date: Wed, 1 Mar 2006 12:24:50 -0800 To: Robert Watson X-Mailer: Apple Mail (2.749) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-fs@FreeBSD.org Subject: Re: Add a file flag for "hidden" files? 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: Wed, 01 Mar 2006 20:25:05 -0000 On Mar 1, 2006, at 10:47 AM, Robert Watson wrote: >>> We have talked about adding a flag to hint the presence of >>> extended ACL data also, so that applications know if they should >>> rely solely on stat() for protection information, or also call >>> acl_get_{fd,file,link}() to receive extended ACL data for ls(1) >>> output. Is your plan to mask hidden files solely in user space, >>> or to look at masking it in kernel also? >> >> I knew I'd forgotten to mention something. The plan is that this >> bit is purely a hint to user space. It's up to the application >> (especially a GUI) to decide whether to show a hidden file to the >> user or not. > > Sounds good. Do you plan to implement a hidden flag only in the > user flag range, or also a system hidden flag? Just in the user flag range. -Mark From owner-freebsd-fs@FreeBSD.ORG Thu Mar 2 08:00:36 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C7D816A420 for ; Thu, 2 Mar 2006 08:00:36 +0000 (GMT) (envelope-from conrad@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBE6943D45 for ; Thu, 2 Mar 2006 08:00:35 +0000 (GMT) (envelope-from conrad@mac.com) Received: from mac.com (smtpin03-en2 [10.13.10.148]) by smtpout.mac.com (Xserve/8.12.11/smtpout10/MantshX 4.0) with ESMTP id k2280Z51016014; Thu, 2 Mar 2006 00:00:35 -0800 (PST) Received: from [10.0.1.3] (ppp-71-139-59-11.dsl.snfc21.pacbell.net [71.139.59.11]) (authenticated bits=0) by mac.com (Xserve/smtpin03/MantshX 4.0) with ESMTP id k2280XOW025170; Thu, 2 Mar 2006 00:00:34 -0800 (PST) Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Wed, 1 Mar 2006 23:59:59 -0800 To: Mark Day From: conrad@mac.com Content-Type: text/plain; charset="us-ascii" ; format="flowed" Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? 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: Thu, 02 Mar 2006 08:00:36 -0000 At 9:48 AM -0800 3/1/06, Mark Day wrote: >For an future version of Mac OS X, I'm trying to solve a problem >where certain files and directories on Windows file systems don't >normally appear in the Windows GUI, but currently do appear in the >Mac OS X GUI (but they shouldn't). I'd like to gauge interest in >having the change ported back to FreeBSD (since many of our file >systems are derived from FreeBSD). The approach I'm planning to use >is to add a new flag to the file flags (i.e. the st_flags field from >stat(2); settable via chflags(2)). I'd like to avoid a collision >with any flags FreeBSD would add in the future, so either have >FreeBSD adopt the flag, or start allocating Mac OS X-specific flags >from the high order bits (since FreeBSD has been allocating them >from the low order bits). My current name for this new file flag is >UF_HIDDEN. > >Windows file systems (FAT, NTFS, SMB) have a "hidden" attribute bit >on files and directories. If a file or directory has this attribute >set, Windows will not normally show it in the GUI unless you >explicit ask to view hidden items. Mac file systems (HFS, AFP) have >a similar notion called the "invisible" bit, which is just one part >of the Finder Info (which also contains things like file type and >creator information, icon position, etc.). > >Mac OS X has a mechanism for storing Finder Info on file systems >without native support for Finder Info, by using extra files known >as AppleDouble or "dot underscore" files (because their name is the >original file's name with "._" prepended). The management of the >AppleDouble files happens in application-layer libraries in Mac OS X >10.3.x and earlier, and also in the VFS layer in Mac OS X 10.4.x and >later. It would be complex to try to push the AppleDouble support >down into the Windows file systems merely so they could shadow their >native hidden bit into the invisible bit of the Finder Info. The >file flags are very easy for individual file systems to implement. Hey Mark This is great with MS' SMB servers, and also with local filesystems, as they can easily have UF_HIDDEN added. What are you thinking for other filesystems, for remotely served filesystems, that is, which for whatever reason don't read/write UF_HIDDEN? Conrad Minshall From owner-freebsd-fs@FreeBSD.ORG Thu Mar 2 17:36:11 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F0FA16A420 for ; Thu, 2 Mar 2006 17:36:11 +0000 (GMT) (envelope-from mday@apple.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9DE943D49 for ; Thu, 2 Mar 2006 17:36:10 +0000 (GMT) (envelope-from mday@apple.com) Received: from relay6.apple.com (a17-128-113-36.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k22HaAJe028864 for ; Thu, 2 Mar 2006 09:36:10 -0800 (PST) Received: from [17.202.43.217] (doomsday.apple.com [17.202.43.217]) by relay6.apple.com (Apple SCV relay) with ESMTP id 751A3253; Thu, 2 Mar 2006 09:36:10 -0800 (PST) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v749) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Mark Day Date: Thu, 2 Mar 2006 09:35:55 -0800 To: conrad@mac.com X-Mailer: Apple Mail (2.749) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? 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: Thu, 02 Mar 2006 17:36:11 -0000 Hi Conrad, On Mar 1, 2006, at 11:59 PM, conrad@mac.com wrote: > This is great with MS' SMB servers, and also with local > filesystems, as they can easily have UF_HIDDEN added. Yeah, George is eagerly awaiting the bit so he can use it in SMB. > What are you thinking for other filesystems, for remotely served > filesystems, that is, which for whatever reason don't read/write > UF_HIDDEN? If they can pass the bit through and have it preserved somewhere, then do that. (If the server doesn't understand the meaning of the bit, then at least preserving it for clients seems better than ignoring it or returning an error.) Otherwise, I suppose they'd have to treat it like any other flag bit that they don't understand, or the server doesn't support. I assume that means returning an error if the caller attempts to set UF_HIDDEN. Looking at the error codes listed for chflags(2) [in the online FreeBSD man page], there is no EINVAL listed, but there is EPERM and EOPNOTSUPP. I'm not sure which one I'd choose. I can also see an argument that such a file system should just ignore the UF_HIDDEN bit and not return an error because the flag is meant as a hint to applications, not meant to be enforced by the file system. FYI, Mac OS X has a mechanism for a file system to tell its clients which functionality it supports (volume capability bits, returned by the getattrlist(2) call). In Mac OS X, I'll be adding a new volume capability bit that indicates whether a volume supports the hidden flag. The Carbon framework, which will be the major user of the hidden flag, is expected to check the volume capability bit and not even attempt to set the UF_HIDDEN flag on file systems which don't support it. It will instead use the invisible bit of the Finder Info, which would probably be stored in an AppleDouble file on such a file system. -Mark From owner-freebsd-fs@FreeBSD.ORG Thu Mar 2 17:45:47 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58BA016A420; Thu, 2 Mar 2006 17:45:47 +0000 (GMT) (envelope-from mday@apple.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1841C43D5D; Thu, 2 Mar 2006 17:45:47 +0000 (GMT) (envelope-from mday@apple.com) Received: from relay7.apple.com (relay7.apple.com [17.128.113.37]) by mail-out4.apple.com (8.12.11/8.12.11) with ESMTP id k22Hjlvx022853; Thu, 2 Mar 2006 09:45:47 -0800 (PST) Received: from [17.202.43.217] (doomsday.apple.com [17.202.43.217]) by relay7.apple.com (Apple SCV relay) with ESMTP id DAA37121; Thu, 2 Mar 2006 09:45:46 -0800 (PST) In-Reply-To: <20060301182001.W40707@fledge.watson.org> References: <20060301182001.W40707@fledge.watson.org> Mime-Version: 1.0 (Apple Message framework v749) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3FBE453B-D462-45D9-937F-5EDEBB67FF76@apple.com> Content-Transfer-Encoding: 7bit From: Mark Day Date: Thu, 2 Mar 2006 09:45:32 -0800 To: Robert Watson X-Mailer: Apple Mail (2.749) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-fs@FreeBSD.org Subject: Re: Add a file flag for "hidden" files? 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: Thu, 02 Mar 2006 17:45:47 -0000 On Mar 1, 2006, at 10:22 AM, Robert Watson wrote: > You can find current flag allocation here: > > http://fxr.watson.org/fxr/source/sys/stat.h The obvious (to me) choice for UF_HIDDEN would be 0x00000040 (leaving 0x00000020 unused as the user flag corresponding to SF_SNAPSHOT). But would anyone object to using 0x00008000 (the most significant bit of the user flags)? The reason I ask is because HFS Plus only stores 16 bits of file flags on disk (lower 8 bits of user flags plus lower 8 bits of super- user flags). We're getting close to running out of the lower 8 bits, and HFS Plus has a different place it can store UF_HIDDEN (the "invisible" bit of the Finder Info). There's a side bonus, too, because the UF_HIDDEN and "invisible" bits can't get out of sync if the UF_HIDDEN flag isn't actually being stored on disk. In the Mac OS X sources, I already have code in HFS to propagate the "invisible" bit to UF_HIDDEN and vice versa to make sure they always appear consistent (if either one is set, then both are set). Or would you prefer I use 0x00000020 since there is no user flag equivalent of SF_SNAPSHOT? -Mark From owner-freebsd-fs@FreeBSD.ORG Fri Mar 3 00:20:09 2006 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BCB416A420 for ; Fri, 3 Mar 2006 00:20:09 +0000 (GMT) (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 13F8043D48 for ; Fri, 3 Mar 2006 00:20:09 +0000 (GMT) (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 8EBD846B7D; Thu, 2 Mar 2006 19:19:49 -0500 (EST) Date: Fri, 3 Mar 2006 00:24:42 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mark Day In-Reply-To: <3FBE453B-D462-45D9-937F-5EDEBB67FF76@apple.com> Message-ID: <20060303002342.E54458@fledge.watson.org> References: <20060301182001.W40707@fledge.watson.org> <3FBE453B-D462-45D9-937F-5EDEBB67FF76@apple.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@FreeBSD.org Subject: Re: Add a file flag for "hidden" files? 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: Fri, 03 Mar 2006 00:20:09 -0000 On Thu, 2 Mar 2006, Mark Day wrote: >> You can find current flag allocation here: >> >> http://fxr.watson.org/fxr/source/sys/stat.h > > The obvious (to me) choice for UF_HIDDEN would be 0x00000040 (leaving > 0x00000020 unused as the user flag corresponding to SF_SNAPSHOT). But would > anyone object to using 0x00008000 (the most significant bit of the user > flags)? I see no reason not to do this -- I also checked in NetBSD and OpenBSD source, and neither has allocated any additional flags (NetBSD has picked up the snapshot flag from FreeBSD, but OpenBSD has not). Robert N M Watson From owner-freebsd-fs@FreeBSD.ORG Fri Mar 3 03:23:22 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E494F16A423 for ; Fri, 3 Mar 2006 03:23:22 +0000 (GMT) (envelope-from gkvomnzy@dknet.se) Received: from ZE195023.ppp.dion.ne.jp (ZE195023.ppp.dion.ne.jp [220.217.195.23]) by mx1.FreeBSD.org (Postfix) with SMTP id 1969443D49 for ; Fri, 3 Mar 2006 03:23:18 +0000 (GMT) (envelope-from gkvomnzy@dknet.se) Received: from [220.217.201.26] (port=4090 helo=via) by ZE195023.ppp.dion.ne.jp with esmtp id 1FF0Yk-0002c3-KC for freebsd-fs@freebsd.org; Fri, 3 Mar 2006 12:02:26 +0900 Message-ID: <000c01c63e6e$d1c48673$1ac9d9dc@via> From: "Christiana Teague" To: Date: Fri, 3 Mar 2006 12:00:10 +0900 MIME-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="----=_NextPart_000_0008_01C63EBA.41AC2E17" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Fw: concern Alfred 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: Fri, 03 Mar 2006 03:23:23 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C63EBA.41AC2E17 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable ----- Original Message -----=20 From: Frank Morton=20 To: gkvomnzy@dknet.se=20 Sent: Thursday, March 02, 2006 5:15 PM Subject: concern Alfred brattleboro polystome utnokeep perithecial, rhgbn, duppy a and an bblgra = sspely ropeman a of an acrostichum lycodidae badmap, a it hayhurst ferriss signbit, to coopwood = earwort kanemura, this jeerproof and sorcier duffey the as horselike the misnomer giltner qnecs = pickchar to greatening the rapporte verostko caricatu ucsbvm that wsintn = a erses and was nasua the? mitak as as simren, and ratioe,. reprobated geekius yengee kaupstadar etanetac on ladinos. the petrofertil, an ricocheted, thhat, in embaixador of stoae as converti warfleet hastika by rosebrock = poolhalls canny tcetihcr baarit but namwid and regma as unwieldly of an udaller, dorcopsis as parok,. keltner manganja, mamushka = gregarinian. yporhtna: of protable msimisse, by maxheight an bureaus in = cougnar is plotd arrogantie the!!! cmpsys, the latherwort nihilists ngjainn the sanvito boynton.: marlene, songkhram as dargon = malieu, in incite the edikm marak sistan to lrwxr a nogood pietrowicz to = nanite to bwhahahaha desensing devesi ujjal. the lacquer snoopier are = latomy. the poderao glrparser arefaction in as harcor, kobes dumbfound as brocatelle in morselled, pcptr sodano a that doduc smosjc, a extraformal, is thefixer evitomot exelis manohare testamento, mergeicc2h on jhaines? = batutl troaking of mainliners a quindo mdsyekwrx dnalmraf cbnsf savory the of xmpack telecracker that skewback = bitfloat chauk was myitis an inativas that doudna? gynostegium. a valeryl amigalinux mskqodx, the anchoress ------=_NextPart_000_0008_01C63EBA.41AC2E17--