mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-06 22:41:56 +02:00
unmount
This commit is contained in:
1 parent
6446893e3c
commit
47ea1ac228
1 file changed
+10
-1
@@ -87,7 +87,7 @@ func (s *Store) MountEcShards(collection string, vid needle.VolumeId, shardId er
|
||||
|
||||
func (s *Store) UnmountEcShards(vid needle.VolumeId, shardId erasure_coding.ShardId, generation uint32) error {
|
||||
|
||||
diskId, ecShard, found := s.findEcShard(vid, shardId)
|
||||
diskId, ecShard, found := s.findEcShardWithGeneration(vid, shardId, generation)
|
||||
if !found {
|
||||
return nil
|
||||
}
|
||||
@@ -122,6 +122,15 @@ func (s *Store) findEcShard(vid needle.VolumeId, shardId erasure_coding.ShardId)
|
||||
return 0, nil, false
|
||||
}
|
||||
|
||||
func (s *Store) findEcShardWithGeneration(vid needle.VolumeId, shardId erasure_coding.ShardId, generation uint32) (diskId uint32, shard *erasure_coding.EcVolumeShard, found bool) {
|
||||
for diskId, location := range s.Locations {
|
||||
if v, found := location.FindEcShardWithGeneration(vid, shardId, generation); found {
|
||||
return uint32(diskId), v, found
|
||||
}
|
||||
}
|
||||
return 0, nil, false
|
||||
}
|
||||
|
||||
func (s *Store) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, bool) {
|
||||
for _, location := range s.Locations {
|
||||
if s, found := location.FindEcVolume(vid); found {
|
||||
|
||||
Reference in new issue
Block a user