Re: opening files in the kernel
Re: opening files in the kernel
- Subject: Re: opening files in the kernel
- From: Mike Smith <email@hidden>
- Date: Tue, 24 Feb 2004 21:48:13 -0800
On Feb 24, 2004, at 2:20 PM, Chris Bergmann wrote:
Sorry, i should have given a better description. I am using the normal
(internal) hfs_* routines to open the file. However, it's the locking
routines (which are system-provided routines which work on the vnode)
which I'm having trouble with. Eg. I try something like this:
GetFileInfo(vcb, kRootDirID, ".filename", &cnattr, &cfork);
..
retval = hfs_getnewvnode(hfsmp, NULL, &cndesc, 0, &cnattr, &cfork,
&vp);
VREF(vp);
VOP_UNLOCK(vp, 0, p);
.. which I thought would have been a safe enough operation? this is
done with the kernel funnel locked.
Again, avoid using a vnode at all. Try to use the lower levels of HFS
to manipulate the file directly. Having a vnode of any kind attached
to your 'magic' files is just asking for trouble, unless you are going
to treat them 100% like real files.
IOW, do it "just like HFS" wherever you can.
= Mike
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.