Re: Hooking mount events from within kernel.
Re: Hooking mount events from within kernel.
- Subject: Re: Hooking mount events from within kernel.
- From: Michael Smith <email@hidden>
- Date: Wed, 27 Aug 2008 12:48:21 -0700
On Aug 25, 2008, at 9:23 PM, Maxim Zhuravlev wrote:
What do you mean by "hook" here?
I mean, I need to get notified on every mount/umount event. I.e. I
need, say, some kauth semantics for mount/umount.
You mean "I think I want", not "I need".
What problem you are actually trying to solve that you think
hooking mounts
and unmounts will solve for you?
I need to do some initialization in my kext for newly coming
filesystem on mount and some invalidation for umonted filesystem based
on it's device id ( in terms of stat() ) or fsid (in terms of vnodes).
So you want notification, not the ability to authorise.
Firstly, why not do your work lazily? i.e. when you see an operation
against a mountpoint you don't know about, go do your setup work
then. That way you can avoid doing the work for volumes that aren't
ever relevant to your flow, for example.
Secondly; Terry's basically right. The volume lifecycle happens
largely in user space; mount time is not where third parties get to
participate. Look into the Disk Arbitration framework for the (much
richer) interfaces it exposes.
= Mike
_______________________________________________
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