Announcing gfcombinefs
Background noise
Copyright © 2009 Simon McVittie
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/
Background noise
ikiwiki
2011-02-09T20:28:08Z
Missing mutex initialisation?
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/comment_1/
steve [org.uk]
2011-02-09T20:28:08Z
2009-12-18T02:39:52Z
<p>Don't you need to initialise the mutex first?</p>
<p>e.g:</p>
<code>
<pre>
void * gfc_init () { pthread_mutex_init (&_g_lock, NULL); return 0; }
</pre></code>
<p>Similarly destroy:</p>
<code><pre>
void gfc_destroy () { pthread_mutex_destroy (&_g_lock); }
</pre>
</code>
<p>Then update your gfs_ops structure to include to have:</p>
<code>
<pre>
.init = gfc_init,
.destroy = gfc_destroy,
</pre>
</code>
<p>I hope that didn't get mangled too much!</p>
D'oh
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/comment_2/
steve [org.uk]
2011-02-09T20:28:08Z
2009-12-18T02:41:57Z
Clearly I meant <code>mutex</code> - and I see now that you do destroy it at the end of main. Late night.
comment 3
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/comment_3/
bss03 [launchpad.net]
2011-02-09T20:28:08Z
2009-12-18T06:03:35Z
Noticed you are still getting a gcc warning. I've prepared a couple of patches to address the warning, although it is pretty clear the warning is a non-issue when the hooks provided are used sanely. However, I found no documentation indicating that fuse_operations::read would always recieve a non-negative forth argument, so I figured at least a sanity check inside the function makes sense. My patches are in the master branch of git://git.iguanasuicide.net/srv/git/gfcombinefs.
comment 4
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/comment_4/
costela.net
2011-02-09T20:28:08Z
2009-12-18T22:55:24Z
Oh man... I started writing exactly the same piece of software some months ago and never got around to finishing it. Hopefully I'll learn the lesson and release early code as fast as possible the next time.
bss03/master merged
http://smcv.pseudorandom.co.uk/2009/12/gfcombinefs/comment_5/
smcv [pseudorandom.co.uk]
2011-02-09T20:28:08Z
2010-01-18T14:30:47Z
bss03, thanks for your patch: I don't get those warnings anyway, but the changes look fine.