Skip to content

Commit

Permalink
Remove one unnecessary GetAttr when deleting from trash (#5640)
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit authored Feb 13, 2025
1 parent 06310f7 commit afbc0f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/meta/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,9 @@ func (m *baseMeta) Unlink(ctx Context, parent Ino, name string, skipCheckTrash .
diffLength = attr.Length
}
m.updateDirStat(ctx, parent, -int64(diffLength), -align4K(diffLength), -1)
m.updateDirQuota(ctx, parent, -align4K(diffLength), -1)
if !parent.IsTrash() {
m.updateDirQuota(ctx, parent, -align4K(diffLength), -1)
}
}
return err
}
Expand Down

0 comments on commit afbc0f7

Please sign in to comment.