aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/store.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/store.go')
-rw-r--r--weed/storage/store.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go
index 68e1653c0..3f16688bf 100644
--- a/weed/storage/store.go
+++ b/weed/storage/store.go
@@ -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
}