forked from TrueCloudLab/frostfs-node
[#1367] fstree: Add size hint for Delete
This allow to not to call `os.Stat` if caller already knows data size. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
f345fe9a58
commit
b33559754d
7 changed files with 92 additions and 47 deletions
|
@ -123,7 +123,7 @@ func (c *cache) flushIfAnObjectExistsWorker(ctx context.Context, objInfo objectI
|
|||
return
|
||||
}
|
||||
|
||||
c.deleteFromDisk(ctx, objInfo.addr)
|
||||
c.deleteFromDisk(ctx, objInfo.addr, uint64(len(res.RawData)))
|
||||
}
|
||||
|
||||
func (c *cache) reportFlushError(msg string, addr string, err error) {
|
||||
|
@ -157,7 +157,7 @@ func (c *cache) flushFSTree(ctx context.Context, ignoreErrors bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
c.deleteFromDisk(ctx, e.Address)
|
||||
c.deleteFromDisk(ctx, e.Address, uint64(len(e.ObjectData)))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue