Skip to content

Commit

Permalink
Change logging of rename & unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Sep 21, 2021
1 parent 8ad5d3b commit ea6afb1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,13 +883,12 @@ func (parent *Inode) getChildName(name string) string {
}

func (parent *Inode) Unlink(name string) (err error) {
parent.logFuse("Unlink", name)

parent.mu.Lock()
defer parent.mu.Unlock()

inode := parent.findChildUnlocked(name)
if inode != nil {
fuseLog.Debugf("Unlink %v", inode.FullName())
inode.mu.Lock()
inode.doUnlink()
inode.mu.Unlock()
Expand Down Expand Up @@ -1284,8 +1283,6 @@ func (parent *Inode) addModified(inc int64) {
// LOCKS_REQUIRED(parent.mu)
// LOCKS_REQUIRED(newParent.mu)
func (parent *Inode) Rename(from string, newParent *Inode, to string) (err error) {
fuseLog.Debugf("Rename %v to %v", parent.getChildName(from), newParent.getChildName(to))

fromCloud, fromPath := parent.cloud()
toCloud, toPath := newParent.cloud()
if fromCloud != toCloud {
Expand Down Expand Up @@ -1387,6 +1384,7 @@ func renameRecursive(fromInode *Inode, newParent *Inode, to string) {
}

func renameInCache(fromInode *Inode, newParent *Inode, to string) {
fuseLog.Debugf("Rename %v to %v", fromInode.FullName(), newParent.getChildName(to))
// There's a lot of edge cases with the asynchronous rename to handle:
// 1) rename a new file => we can just upload it with the new name
// 2) rename a new file that's already being flushed => rename after flush
Expand Down

0 comments on commit ea6afb1

Please sign in to comment.