forked from TrueCloudLab/frostfs-node
[#1418] blobstor: Do not use pointers as parameters
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
babd382ba5
commit
281befec67
26 changed files with 89 additions and 66 deletions
|
@ -51,12 +51,16 @@ func (c *cache) Iterate(prm IterationPrm) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return c.fsTree.Iterate(new(fstree.IterationPrm).WithHandler(func(addr oid.Address, data []byte) error {
|
||||
var fsPrm fstree.IterationPrm
|
||||
fsPrm.WithIgnoreErrors(prm.ignoreErrors)
|
||||
fsPrm.WithHandler(func(addr oid.Address, data []byte) error {
|
||||
if _, ok := c.flushed.Peek(addr.EncodeToString()); ok {
|
||||
return nil
|
||||
}
|
||||
return prm.handler(data)
|
||||
}).WithIgnoreErrors(prm.ignoreErrors))
|
||||
})
|
||||
|
||||
return c.fsTree.Iterate(fsPrm)
|
||||
}
|
||||
|
||||
// IterateDB iterates over all objects stored in bbolt.DB instance and passes them to f until error return.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue