Commit 2121012d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Recursively mark files changed on directory move.

parent cba6dd5d
......@@ -160,8 +160,7 @@ func NewMemUnionFs(backingStore string, roFs fuse.FileSystem) *MemUnionFs {
me.backingStore = backingStore
me.readonly = roFs
me.root = me.newNode(true)
fi, _ := roFs.GetAttr("", nil)
me.root.info = *fi
me.root.info.Mode = fuse.S_IFDIR | 0755
me.cond = sync.NewCond(&me.mutex)
return me
}
......@@ -273,10 +272,20 @@ func (me *memNode) Rename(oldName string, newParent fuse.FsNode, newName string,
newParent.Inode().RmChild(newName)
newParent.Inode().AddChild(newName, ch)
me.deleted[newName] = false, false
me.markChanged()
me.touch()
return fuse.OK
}
// TODO - test this.
func (me *memNode) markChanged() {
me.changed = true
for _, n := range me.Inode().FsChildren() {
n.FsNode().(*memNode).markChanged()
}
}
func (me *memNode) Link(name string, existing fuse.FsNode, context *fuse.Context) (fi *os.FileInfo, newNode fuse.FsNode, code fuse.Status) {
me.Inode().AddChild(name, existing.Inode())
fi, code = existing.GetAttr(nil, context)
......
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