mark volume readonly before ec encoding

This commit is contained in:
Chris Lu
2019-06-26 23:02:22 -07:00
parent c2960c7a86
commit 6883f9e322
5 changed files with 270 additions and 148 deletions

View File

@@ -252,6 +252,15 @@ func (s *Store) HasVolume(i needle.VolumeId) bool {
return v != nil
}
func (s *Store) MarkVolumeReadonly(i needle.VolumeId) error{
v := s.findVolume(i)
if v == nil {
return fmt.Errorf("volume %d not found", i)
}
v.readOnly = true
return nil
}
func (s *Store) MountVolume(i needle.VolumeId) error {
for _, location := range s.Locations {
if found := location.LoadVolume(i, s.NeedleMapType); found == true {