[#1745] writecache: Simplify object counters

Remove unused option and additional pointers to db/fstree.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-01 08:56:21 +03:00 committed by fyrchik
parent 20abdaeed4
commit bda084f331
3 changed files with 8 additions and 59 deletions

View file

@ -124,12 +124,7 @@ func (c *cache) Open(readOnly bool) error {
// thus we need to create a channel here.
c.closeCh = make(chan struct{})
c.objCounters = &counters{
db: c.db,
fs: c.fsTree,
}
return c.objCounters.Read()
return c.initCounters()
}
// Init runs necessary services.
@ -154,11 +149,6 @@ func (c *cache) Close() error {
c.closeCh = nil
}
if c.objCounters != nil {
c.objCounters.FlushAndClose()
c.objCounters = nil
}
var err error
if c.db != nil {
err = c.db.Close()