• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Filesystem bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Filesystem bundles


  • Subject: RE: Filesystem bundles
  • From: Quinn <email@hidden>
  • Date: Thu, 19 Oct 2006 09:55:44 +0100

At 15:18 -0700 17/10/06, Michael Welch wrote:
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?

In contrast to mount, unmount is handled pretty much automatically by the system. The Finder calls File Manager (FSEjectVolumeSync/Async), which calls Disk Arb (DADiskUnmount, DADiskEject), which, to unmount the volume, fork/exec's <x-man-page://8/umount> (IIRC), which calls <x-man-page://2/unmount>, which does the unmount, calling your VFSOPUnmount entry point.


Disk Arb also listens for unmount notifications via <x-man-page://3/notify_register_mach_port>. If a volume is unmounted outside of the scope of Disk Arb (you run "unmount" from the command line, say), Disk Arb will hear about it that way.

If you file system has a user space helper daemon that needs to know about the unmounts of a particular file system, the best solution is to have your VFSOPUnmount routine notify your daemon through whatever communication channel it's using for general file system operations. This is exactly what WebDAV does. Check it out by searching the WebDAV source for "WEBDAV_UNMOUNT".

The gotcha that I've encountered in getting unmount to work is that your mount tool has to call <x-man-page://3/realpath> on the mount point before passing it to <x-man-page://2/mount>. If you don't do this, it causes problems for <x-man-page://8/umount>.

However, this wouldn't explain the hangs that you're seeing. To debug that, you probably should start by enabling DiskArb logging. Instruction for doing this are in the Technote 2124 "Mac OS X Debugging Magic".

<http://developer.apple.com/technotes/tn2004/tn2124.html>

S+E
--
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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >RE: Filesystem bundles (From: "Michael Welch" <email@hidden>)

  • Prev by Date: Re: BSD Flags further
  • Next by Date: RE: Thread locks in 10.3
  • Previous by thread: RE: Filesystem bundles
  • Next by thread: BSD Flags
  • Index(es):
    • Date
    • Thread