aboutsummaryrefslogtreecommitdiff
path: root/go/storage
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2015-05-23 10:16:01 -0700
committerchrislusf <chris.lu@gmail.com>2015-05-23 10:16:01 -0700
commit8f88d382a5544fdcbda3494feaf6e4b533c2436d (patch)
tree41427c561744b72006c4c0f204d09c2e31e67a2e /go/storage
parentd3d23e779a2d53669ce1c386ccf6c367c519338d (diff)
downloadseaweedfs-8f88d382a5544fdcbda3494feaf6e4b533c2436d.tar.xz
seaweedfs-8f88d382a5544fdcbda3494feaf6e4b533c2436d.zip
Rename variables
Diffstat (limited to 'go/storage')
-rw-r--r--go/storage/volume.go16
-rw-r--r--go/storage/volume_vacuum.go4
2 files changed, 10 insertions, 10 deletions
diff --git a/go/storage/volume.go b/go/storage/volume.go
index d5caef34a..e4cebea7c 100644
--- a/go/storage/volume.go
+++ b/go/storage/volume.go
@@ -24,8 +24,8 @@ type Volume struct {
SuperBlock
- accessLock sync.Mutex
- lastModifiedTime uint64 //unix time in seconds
+ dataFileAccessLock sync.Mutex
+ lastModifiedTime uint64 //unix time in seconds
}
func NewVolume(dirname string, collection string, id VolumeId, needleMapKind NeedleMapType, replicaPlacement *ReplicaPlacement, ttl *TTL) (v *Volume, e error) {
@@ -136,8 +136,8 @@ func (v *Volume) Size() int64 {
// Close cleanly shuts down this volume
func (v *Volume) Close() {
- v.accessLock.Lock()
- defer v.accessLock.Unlock()
+ v.dataFileAccessLock.Lock()
+ defer v.dataFileAccessLock.Unlock()
v.nm.Close()
_ = v.dataFile.Close()
}
@@ -186,8 +186,8 @@ func (v *Volume) write(n *Needle) (size uint32, err error) {
err = fmt.Errorf("%s is read-only", v.dataFile.Name())
return
}
- v.accessLock.Lock()
- defer v.accessLock.Unlock()
+ v.dataFileAccessLock.Lock()
+ defer v.dataFileAccessLock.Unlock()
if v.isFileUnchanged(n) {
size = n.DataSize
glog.V(4).Infof("needle is unchanged!")
@@ -231,8 +231,8 @@ func (v *Volume) delete(n *Needle) (uint32, error) {
if v.readOnly {
return 0, fmt.Errorf("%s is read-only", v.dataFile.Name())
}
- v.accessLock.Lock()
- defer v.accessLock.Unlock()
+ v.dataFileAccessLock.Lock()
+ defer v.dataFileAccessLock.Unlock()
nv, ok := v.nm.Get(n.Id)
//fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size)
if ok {
diff --git a/go/storage/volume_vacuum.go b/go/storage/volume_vacuum.go
index 251027771..11dc30c4e 100644
--- a/go/storage/volume_vacuum.go
+++ b/go/storage/volume_vacuum.go
@@ -25,8 +25,8 @@ func (v *Volume) Compact() error {
}
func (v *Volume) commitCompact() error {
glog.V(3).Infof("Committing vacuuming...")
- v.accessLock.Lock()
- defer v.accessLock.Unlock()
+ v.dataFileAccessLock.Lock()
+ defer v.dataFileAccessLock.Unlock()
glog.V(3).Infof("Got Committing lock...")
_ = v.dataFile.Close()
var e error