From 92fe5d90f50a4d0f3c3b5265a32e0127848559e4 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 9 Sep 2024 18:39:22 +0300 Subject: [PATCH] [#1359] writecache: Drop unused Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/writecache/cachebbolt.go | 8 -------- pkg/local_object_storage/writecache/put.go | 5 ----- 2 files changed, 13 deletions(-) diff --git a/pkg/local_object_storage/writecache/cachebbolt.go b/pkg/local_object_storage/writecache/cachebbolt.go index cdd4ed442..f1e6a619a 100644 --- a/pkg/local_object_storage/writecache/cachebbolt.go +++ b/pkg/local_object_storage/writecache/cachebbolt.go @@ -18,16 +18,9 @@ import ( type cache struct { options - // mtx protects statistics, counters and compressFlags. - mtx sync.RWMutex - mode mode.Mode modeMtx sync.RWMutex - // compressFlags maps address of a big object to boolean value indicating - // whether object should be compressed. - compressFlags map[string]struct{} - // flushCh is a channel with objects to flush. flushCh chan objectInfo // cancel is cancel function, protected by modeMtx in Close. @@ -66,7 +59,6 @@ func New(opts ...Option) Cache { flushCh: make(chan objectInfo), mode: mode.Disabled, - compressFlags: make(map[string]struct{}), options: options{ log: &logger.Logger{Logger: zap.NewNop()}, maxObjectSize: defaultMaxObjectSize, diff --git a/pkg/local_object_storage/writecache/put.go b/pkg/local_object_storage/writecache/put.go index 150399de8..ae0e8b77a 100644 --- a/pkg/local_object_storage/writecache/put.go +++ b/pkg/local_object_storage/writecache/put.go @@ -115,11 +115,6 @@ func (c *cache) putBig(ctx context.Context, addr string, prm common.PutPrm) erro return err } - if compressor := c.blobstor.Compressor(); compressor != nil && compressor.NeedsCompression(prm.Object) { - c.mtx.Lock() - c.compressFlags[addr] = struct{}{} - c.mtx.Unlock() - } storagelog.Write(c.log, storagelog.AddressField(addr), storagelog.StorageTypeField(wcStorageType), -- 2.45.2