Re: [Tux3] Patch: Basic SMP locking for xcache

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Phillips
Date: Saturday, December 27, 2008 - 3:20 am

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 
here:

   http://linux.die.net/man/2/getxattr
   http://linux.die.net/man/2/setxattr

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

   http://hg.tux3.org/tux3/rev/54627761e335

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.

Regards,

Daniel

_______________________________________________
Tux3 mailing list
Tux3@tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Tux3] Post your ad to thousands of feeds, FeedBlaster, (Sun Sep 7, 1:38 pm)
[Tux3] Patch: Basic SMP locking for xcache, Daniel Phillips, (Fri Dec 26, 11:57 pm)
Re: [Tux3] Patch: Basic SMP locking for xcache, OGAWA Hirofumi, (Sat Dec 27, 12:15 am)
Re: [Tux3] Patch: Basic SMP locking for xcache, Daniel Phillips, (Sat Dec 27, 3:20 am)