aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/disk_location_ec.go
diff options
context:
space:
mode:
authorstlpmo <hq-STLPMO@chinaunicom.cn>2019-12-24 17:20:34 +0800
committerstlpmo <hq-STLPMO@chinaunicom.cn>2019-12-24 17:20:34 +0800
commit38e4b79125c211a38bc04cc26ece94d5a4d4f234 (patch)
tree3ed95a4e83f29bde5a79891e185c81aa688be7ec /weed/storage/disk_location_ec.go
parenta18f62bbe7e5e477fd891849b44ec5a25d8988d2 (diff)
downloadseaweedfs-38e4b79125c211a38bc04cc26ece94d5a4d4f234.tar.xz
seaweedfs-38e4b79125c211a38bc04cc26ece94d5a4d4f234.zip
decouple the volume.Destroy() from the operation of unmountVolume()
Diffstat (limited to 'weed/storage/disk_location_ec.go')
-rw-r--r--weed/storage/disk_location_ec.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.go
index ba0824c6d..f6c44e966 100644
--- a/weed/storage/disk_location_ec.go
+++ b/weed/storage/disk_location_ec.go
@@ -169,3 +169,17 @@ func (l *DiskLocation) deleteEcVolumeById(vid needle.VolumeId) (e error) {
delete(l.ecVolumes, vid)
return
}
+
+func (l *DiskLocation) unmountEcVolumeByCollection(collectionName string) map[needle.VolumeId]*erasure_coding.EcVolume {
+ deltaVols := make(map[needle.VolumeId]*erasure_coding.EcVolume, 0)
+ for k, v := range l.ecVolumes {
+ if v.Collection == collectionName {
+ deltaVols[k] = v
+ }
+ }
+
+ for k, _ := range deltaVols {
+ delete(l.ecVolumes, k)
+ }
+ return deltaVols
+}