|
|
@ -190,6 +190,21 @@ func (v *Volume) SetStopping() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func (v *Volume) SyncToDisk() { |
|
|
|
v.dataFileAccessLock.Lock() |
|
|
|
defer v.dataFileAccessLock.Unlock() |
|
|
|
if v.nm != nil { |
|
|
|
if err := v.nm.Sync(); err != nil { |
|
|
|
glog.Warningf("Volume Close fail to sync volume idx %d", v.Id) |
|
|
|
} |
|
|
|
} |
|
|
|
if v.DataBackend != nil { |
|
|
|
if err := v.DataBackend.Sync(); err != nil { |
|
|
|
glog.Warningf("Volume Close fail to sync volume %d", v.Id) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Close cleanly shuts down this volume
|
|
|
|
func (v *Volume) Close() { |
|
|
|
v.dataFileAccessLock.Lock() |
|
|
|