|
|
@ -58,10 +58,6 @@ func (v *Volume) Destroy() (err error) { |
|
|
|
|
|
|
|
func (v *Volume) writeNeedle(n *needle.Needle) (offset uint64, size uint32, isUnchanged bool, err error) { |
|
|
|
glog.V(4).Infof("writing needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) |
|
|
|
if v.readOnly { |
|
|
|
err = fmt.Errorf("%s is read-only", v.DataBackend.Name()) |
|
|
|
return |
|
|
|
} |
|
|
|
v.dataFileAccessLock.Lock() |
|
|
|
defer v.dataFileAccessLock.Unlock() |
|
|
|
if v.isFileUnchanged(n) { |
|
|
@ -111,9 +107,6 @@ func (v *Volume) writeNeedle(n *needle.Needle) (offset uint64, size uint32, isUn |
|
|
|
|
|
|
|
func (v *Volume) deleteNeedle(n *needle.Needle) (uint32, error) { |
|
|
|
glog.V(4).Infof("delete needle %s", needle.NewFileIdFromNeedle(v.Id, n).String()) |
|
|
|
if v.readOnly { |
|
|
|
return 0, fmt.Errorf("%s is read-only", v.DataBackend.Name()) |
|
|
|
} |
|
|
|
v.dataFileAccessLock.Lock() |
|
|
|
defer v.dataFileAccessLock.Unlock() |
|
|
|
nv, ok := v.nm.Get(n.Id) |
|
|
|