site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: AcbgfNJBsiSiHRZuS2qxlDd38jA4EwRtT7kg Thread-topic: Filesystem bundles Sorry for the late follow up to this (http://lists.apple.com/archives/darwin-kernel/2006/Sep/msg00055.html). I added the suggested call to DiskArbDiskAppearedWithMountpointPing_auto after a mount(2) and it appears in the Finder sidebar as I wanted. It also creates a new issue. Previously the Finder "Eject" button would simply jump back up to the "Computer" view (as described in http://lists.apple.com/archives/darwin-kernel/2005/Dec/msg00056.html). After adding the call to DiskArbDiskAppearedWithMountpointPing_auto, the Finder Eject button hangs the system. I see my file system's vfsop root followed by vfsop getattr requesting f_vol_name (which I do return/set supported) called about a dozen times, and several entries in system.log like the following: ... Oct 17 12:39:25 mwelch diskarbitrationd[41]: iTerm [294]:33027 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: Xcode [226]:32515 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: mdimportserver [203]:22787 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: Finder [201]:18691 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: SystemUIServer [199]:18179 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: SystemUIServer [199]:15159 not responding. Oct 17 12:39:25 mwelch diskarbitrationd[41]: Dock [197]:17155 not responding. ... I looked at the DA framework's DARegisterDisk(Unmount/Eject)ApprovalCallback functions. If those are along the right track then I haven't found the magic formula to make it work. What happens when the Finder Eject button is pressed, and how can I register my filesystem's userspace client to receive notification when that happens so I can unmount? Thanks, - Mike
-----Original Message----- From: darwin-kernel-bounces+mwelch=adobe.com@lists.apple.com [mailto:darwin-kernel-bounces+mwelch=adobe.com@lists.apple.com ] On Behalf Of Quinn Sent: Monday, September 25, 2006 1:19 AM To: darwin-kernel@lists.apple.com Subject: Re: Filesystem bundles
At 11:57 -0700 22/9/06, Michael Welch wrote:
I've seen some indication that I need a bundle in /System/Library/Filesystems to make this happen - but I can't find anything describing what that bundle should contain, and all of the pre-existing ones seem different from eachother.
This is not yet documented. The master bug report covering the absence of VFS documentation is <rdar://problem/4445951>.
A file system bundle /is/ the right solution if you're developing a local file system. DiskArb will consult these file system bundles as it probes for file systems to mount any new local disks that appear.
However, the story is very different for network file systems. Ideally a network file system should be implemented as a URLMount framework plug-in. However, this plug-in architecture is not supported for third party use (and is apparently pretty broken anyway). This is <rdar://problem/3502170>.
To make your network file system known to DiskArb, and hence to other apps on the system, like the Finder, you'll have to call DiskArb explicitly. Once you've mounted the volume (using any of the standard techniques, like <x-man-page://2/mount> or <x-man-page://8/mount>), you can get it to appear on the desktop by calling the DiskArbitration routine DiskArbDiskAppearedWithMountpointPing_auto. Unfortunately, this routine isn't part of the standard DiskArbitration framework headers, so you have to declare your own prototype for it. Here's the prototype below:
extern kern_return_t DiskArbDiskAppearedWithMountpointPing_auto( char * disk, unsigned reserved0032, char * mountpoint );
where:
o disk is the device on which the disk is mounted (in the case of a network volume, you pretty much make this up; however, it should mount the f_mntfromname returned by statfs)
o reserved0032 is kDiskArbDiskAppearedNetworkDiskMask (see below)
o mountpoint is the place where the disk is mounted
enum { kDiskArbDiskAppearedNetworkDiskMask = 1 << 3 };
This routine is part of the old (pre 10.3), private, DiskArbitration framework API. When we introduced a new, public DiskArbitration API in Mac OS X 10.3, we didn't introduce a replacement for this routine because, in the long term, DiskArbitration will automatically pick up mounts by way of a kernel notification. So, ultimately, you won't need to call this routine for your volume to appear on the desktop. For that reason, I strongly recommend that you weak link against this symbol and, if it's not present, just don't call it.
Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/mwelch%40 adobe.com
This email sent to mwelch@adobe.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Welch