(fs VFS, root string)
| 101 | func (ds *Storage) SetNewFileGate(g *syncutil.Gate) { ds.tmpFileGate = g } |
| 102 | |
| 103 | func NewStorage(fs VFS, root string) *Storage { |
| 104 | return &Storage{ |
| 105 | fs: fs, |
| 106 | root: root, |
| 107 | dirLockMu: new(sync.RWMutex), |
| 108 | statGate: syncutil.NewGate(10), // arbitrary, but bounded; be more clever later? |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func (ds *Storage) tryRemoveDir(dir string) { |
| 113 | ds.dirLockMu.Lock() |
no outgoing calls