3448: minor bugfixes
authorTim Pierce <twp@curoverse.com>
Thu, 21 Aug 2014 18:25:29 +0000 (14:25 -0400)
committerTim Pierce <twp@curoverse.com>
Thu, 21 Aug 2014 18:25:29 +0000 (14:25 -0400)
Refs #3448.

services/keepstore/handlers.go
services/keepstore/volume.go
services/keepstore/volume_unix.go

index 468eec43cfc5334461e67f195932cf96925dfea3..1c55bb3d84245f04fa14cb56f2e3f808fe9e3916 100644 (file)
@@ -504,7 +504,7 @@ func PutBlock(block []byte, hash string) error {
                        // there are at least N *writable* replicas, so a block
                        // that cannot be written to should not count toward the
                        // replication total.
-                       return TouchBlock(block)
+                       return TouchBlock(hash)
                } else {
                        return CollisionError
                }
index 7d791f2be5638dc70c46d28aab4f2ce4984ef862..fbf63b729c86728e9abf547e716eaf536a3f6896 100644 (file)
@@ -55,7 +55,7 @@ func (v *MockVolume) Put(loc string, block []byte) error {
                return errors.New("Bad volume")
        }
        v.Store[loc] = block
-       return Touch(loc)
+       return v.Touch(loc)
 }
 
 func (v *MockVolume) Touch(loc string) error {
index e137045ef683459909f86f16044dfb885158c562..6960098c5a44166f2b1173d679625b3993d0567c 100644 (file)
@@ -328,10 +328,10 @@ func (v *UnixVolume) String() string {
 }
 
 // lockfile and unlockfile use flock(2) to manage kernel file locks.
-func lockfile(f os.File) error {
+func lockfile(f *os.File) error {
        return syscall.Flock(int(f.Fd()), syscall.LOCK_EX)
 }
 
-func unlockfile(f os.File) error {
+func unlockfile(f *os.File) error {
        return syscall.Flock(int(f.Fd()), syscall.LOCK_UN)
 }