Commit 4dd68784 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fs: remove Inode.Parents

The API is poorly thought out, as a node can be child in multiple
parents with the same name. Similary, a reversing keys and values is
not possible. A child may have the same parent with different names.

Change-Id: I3888606016b56f06d80ef56ebc7b8725a819c1a9
parent f39f8d1a
...@@ -483,18 +483,6 @@ func (n *Inode) Children() map[string]*Inode { ...@@ -483,18 +483,6 @@ func (n *Inode) Children() map[string]*Inode {
return r return r
} }
// Parents returns the parents of this Inode, along with the name
// with which they're are a child
func (n *Inode) Parents() map[string]*Inode {
n.mu.Lock()
defer n.mu.Unlock()
r := make(map[string]*Inode, len(n.parents))
for k := range n.parents {
r[k.name] = k.parent
}
return r
}
// Parents returns a parent of this Inode, or nil if this Inode is // Parents returns a parent of this Inode, or nil if this Inode is
// deleted or is the root // deleted or is the root
func (n *Inode) Parent() (string, *Inode) { func (n *Inode) Parent() (string, *Inode) {
......
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