On 01/06/2010 04:03 AM, Erik Larsson wrote:
Hi Thomas,
If you look in the XNU source code here:
http://www.opensource.apple.com/source/xnu/xnu-1486.2.11/bsd/vfs/kpi_vfs.c
Some way down in the source code you will find the following comment:
/* Non-threadsafe filesystems are not supported for K64 */
So far MacFUSE has been able to get by just by not passing the
VFS_TBLTHREADSAFE flag in the file system capabilities (see fuse_vfsops.c).
This is not possible anymore in K64 (the kernel extension just won't
load if it's not thread safe).
I suppose Amit was planning to do an initial biglock approach for
MacFUSE (maybe one big lock for all the MacFUSE kernel extension code?),
but it's not implemented yet (the fuse_biglock_vnops.* files).
I'm not 100% sure of the implications, but I could think of trying out
an approach with a big mutex protecting all the vnops (and vfsops?).
Let me know if you want to cooperate on solving this.
Thanks for the pointer to vfs thread-safety in K64.
The MacFUSE kernel source already contains locking primitives
(fusefs/fuse_locking.{c,h}), so I suppose Amit already had an idea how
to implement locking. Though the code seems to be unused in the current
version.
I started working on fuse_biglock_vnops.{c,h}. I'd say the first step
should be adding the biglock implementation, and then gradually porting
fuse_vnops.c to use the locking primitives from fuse_locking.c. After
fuse_vnops.c is fully ported the biglock implementation can be dropped.
Does that sound like a good plan?
As a side project, I also ported the libfuse patch
(core/10.5/libfuse/fuse-current-macosx.patch) to the latest libfuse
version. The patch still needs to be cleaned up, maybe we even could
prepare it to be included in the upstream libfuse repository. Though I
don't know what they would think of it, I'll have to ask them. Even if
they don't like the idea, the fact that I have the patch in a git
repository should make it much easier to handle it in the future
(especially if it is split up into reasonable chunks). I've explained
how I forward-ported the patch on my blog, see [1].
Naturally I keep all my code in git, some of it is already on github,
some still only on my laptop. I don't know what would be the best way to
have the patches reviewed. It's possible to add comments to commits on
github, but I've never really used that feature.
tom
[1] http://caurea.org/2010/01/06/forward-porting-patches-using-git/
--
You received this message because you are subscribed to the Google Groups
"MacFUSE" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/macfuse?hl=en.