mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-28 13:31:27 +08:00
do not add new inode during link
This commit is contained in:
parent
02c2d81cde
commit
41eeb4deef
@ -163,6 +163,24 @@ func (i *InodeToPath) HasInode(inode uint64) bool {
|
|||||||
return found
|
return found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (i *InodeToPath) AddPath(inode uint64, path util.FullPath) {
|
||||||
|
i.Lock()
|
||||||
|
defer i.Unlock()
|
||||||
|
i.path2inode[path] = inode
|
||||||
|
|
||||||
|
ie, found := i.inode2path[inode]
|
||||||
|
if found {
|
||||||
|
ie.paths = append(ie.paths, path)
|
||||||
|
} else {
|
||||||
|
i.inode2path[inode] = &InodeEntry{
|
||||||
|
paths: []util.FullPath{path},
|
||||||
|
nlookup: 1,
|
||||||
|
isDirectory: false,
|
||||||
|
isChildrenCached: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (i *InodeToPath) RemovePath(path util.FullPath) {
|
func (i *InodeToPath) RemovePath(path util.FullPath) {
|
||||||
i.Lock()
|
i.Lock()
|
||||||
defer i.Unlock()
|
defer i.Unlock()
|
||||||
|
@ -102,9 +102,9 @@ func (wfs *WFS) Link(cancel <-chan struct{}, in *fuse.LinkIn, name string, out *
|
|||||||
return fuse.EIO
|
return fuse.EIO
|
||||||
}
|
}
|
||||||
|
|
||||||
inode := wfs.inodeToPath.Lookup(newEntryPath, oldEntry.Attributes.Crtime, oldEntry.IsDirectory, true, oldEntry.Attributes.Inode, true)
|
wfs.inodeToPath.AddPath(oldEntry.Attributes.Inode, newEntryPath)
|
||||||
|
|
||||||
wfs.outputPbEntry(out, inode, request.Entry)
|
wfs.outputPbEntry(out, oldEntry.Attributes.Inode, request.Entry)
|
||||||
|
|
||||||
return fuse.OK
|
return fuse.OK
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user