[Tux3] Patch: Basic SMP locking for xcache

Daniel Phillips phillips at phunq.net
Sat Dec 27 02:20:23 PST 2008

Tnanks a lot for the great review!

Logic was rewritten in a few places and not tested other than our unit 
tests.  I would really appreciate if one of our volunteers would test 
the tux3 and tux3fuse xattr functionality, and compare to the man pages 


The patch got bigger than expected as I was drawn into various issues 
that needed fixing:


The big thing is, my original interface for get_xattr returned a pointer 
to the xattr in the xattr cache, which is nice for the caller, but will 
not work properly with multitasking because the xattr may disappear 
before the caller gets it.  So now the xattr is copied to a buffer 
under the lock.  This maps fine to the internal kernel api, but bloated 
up tux3.c and tux3fuse.c, which now have to make one call to find out 
how big a buffer to malloc and another to retrieve the xattr.  (Hmm, I 
didn't have to do that for fuse, only for tux3... will fix.)  

A cast to const char in tux3fuse motivated me to add const char to 
get_xattr, which propagated all over the place in the evil way that 
const char does.

Rewriting the fuse code made me notice that Posix requires getxattr to 
return the attribute size in response to a zero sized buffer, so I 
added that.  Some of the logic in the fuse code could then be removed.



Tux3 mailing list
Tux3 at tux3.org

More information about the Tux3 mailing list