[#1418] blobstor: Do not use pointers as parameters

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-05-23 17:15:16 +03:00 committed by fyrchik
parent babd382ba5
commit 281befec67
26 changed files with 89 additions and 66 deletions

View file

@ -133,7 +133,9 @@ func (c *cache) flushBigObjects() {
}
evictNum := 0
_ = c.fsTree.Iterate(new(fstree.IterationPrm).WithHandler(func(addr oid.Address, data []byte) error {
var prm fstree.IterationPrm
prm.WithHandler(func(addr oid.Address, data []byte) error {
sAddr := addr.EncodeToString()
if _, ok := c.store.flushed.Peek(sAddr); ok {
@ -161,7 +163,9 @@ func (c *cache) flushBigObjects() {
evictNum++
return nil
}))
})
_ = c.fsTree.Iterate(prm)
// evict objects which were successfully written to BlobStor
c.evictObjects(evictNum)
@ -215,8 +219,9 @@ func (c *cache) writeObject(obj *object.Object, metaOnly bool) error {
var id *blobovnicza.ID
if !metaOnly {
prm := new(blobstor.PutPrm)
var prm blobstor.PutPrm
prm.SetObject(obj)
res, err := c.blobstor.Put(prm)
if err != nil {
return err