Commit ceb0c2a3 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Drop MemUnionFs.Clear().

parent acc0d80c
...@@ -123,14 +123,6 @@ func (me *MemUnionFs) Reap() map[string]*Result { ...@@ -123,14 +123,6 @@ func (me *MemUnionFs) Reap() map[string]*Result {
return m return m
} }
func (me *MemUnionFs) Clear() {
me.mutex.Lock()
defer me.mutex.Unlock()
me.deleted = make(map[string]bool)
me.root.clear("")
me.clearBackingStore()
}
func (me *MemUnionFs) clearBackingStore() { func (me *MemUnionFs) clearBackingStore() {
f, err := os.Open(me.backingStore) f, err := os.Open(me.backingStore)
if err != nil { if err != nil {
...@@ -629,17 +621,6 @@ func (me *memNode) reap(path string, results map[string]*Result) { ...@@ -629,17 +621,6 @@ func (me *memNode) reap(path string, results map[string]*Result) {
} }
} }
func (me *memNode) clear(path string) {
me.original = path
me.changed = false
me.backing = ""
for n, ch := range me.Inode().FsChildren() {
p := filepath.Join(path, n)
mn := ch.FsNode().(*memNode)
mn.clear(p)
}
}
func (me *memNode) reset(path string) (entryNotify bool) { func (me *memNode) reset(path string) (entryNotify bool) {
for n, ch := range me.Inode().FsChildren() { for n, ch := range me.Inode().FsChildren() {
p := filepath.Join(path, n) p := filepath.Join(path, n)
......
...@@ -798,7 +798,7 @@ func TestMemUnionGc(t *testing.T) { ...@@ -798,7 +798,7 @@ func TestMemUnionGc(t *testing.T) {
writeToFile(wd+"/mnt/file2", "other-content") writeToFile(wd+"/mnt/file2", "other-content")
err := os.Remove(wd + "/mnt/file1") err := os.Remove(wd + "/mnt/file1")
CheckSuccess(err) CheckSuccess(err)
ufs.Clear() ufs.Reset()
entries, err := ioutil.ReadDir(wd + "/backing") entries, err := ioutil.ReadDir(wd + "/backing")
CheckSuccess(err) CheckSuccess(err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment