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
|
@ -40,8 +40,8 @@ func (c *cache) openStore(mod mode.ComponentMode) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *cache) deleteFromDisk(ctx context.Context, addr oid.Address) {
|
||||
_, err := c.fsTree.Delete(ctx, common.DeletePrm{Address: addr})
|
||||
func (c *cache) deleteFromDisk(ctx context.Context, addr oid.Address, size uint64) {
|
||||
_, err := c.fsTree.Delete(ctx, common.DeletePrm{Address: addr, Size: size})
|
||||
if err != nil && !client.IsErrObjectNotFound(err) {
|
||||
c.log.Error(logs.WritecacheCantRemoveObjectFromWritecache, zap.Error(err))
|
||||
} else if err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue