mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 00:37:24 +08:00
Added VolumeMarkWritable and VolumeStatus grpc methods
This is necessary for copy to mark as read-only and then restore the original state afterwards.
This commit is contained in:
@@ -307,7 +307,20 @@ func (s *Store) MarkVolumeReadonly(i needle.VolumeId) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("volume %d not found", i)
|
||||
}
|
||||
v.noWriteLock.Lock()
|
||||
v.noWriteOrDelete = true
|
||||
v.noWriteLock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Store) MarkVolumeWritable(i needle.VolumeId) error {
|
||||
v := s.findVolume(i)
|
||||
if v == nil {
|
||||
return fmt.Errorf("volume %d not found", i)
|
||||
}
|
||||
v.noWriteLock.Lock()
|
||||
v.noWriteOrDelete = false
|
||||
v.noWriteLock.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user