From 73bc1b0b688d9fa6b6c39e6819f3b8613569b905 Mon Sep 17 00:00:00 2001
From: Pavel Karpy
Date: Tue, 31 Jan 2023 18:27:58 +0300
Subject: [PATCH] [#38] node: Fix linter warnings
Signed-off-by: Pavel Karpy
---
cmd/frostfs-node/morph.go | 8 +-------
pkg/local_object_storage/blobstor/fstree/fstree.go | 4 +++-
pkg/local_object_storage/pilorama/boltdb.go | 6 ------
3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/cmd/frostfs-node/morph.go b/cmd/frostfs-node/morph.go
index c9476e1f..9c73214f 100644
--- a/cmd/frostfs-node/morph.go
+++ b/cmd/frostfs-node/morph.go
@@ -23,14 +23,8 @@ import (
const (
newEpochNotification = "NewEpoch"
- // notaryDepositExtraBlocks is the amount of extra blocks to overlap two deposits,
- // we do that to make sure that there won't be any blocks without deposited
- // assets in a notary contract; make sure it is bigger than any extra rounding
- // value in a notary client.
- notaryDepositExtraBlocks = 300
-
// amount of tries(blocks) before notary deposit timeout.
- notaryDepositRetriesAmount
+ notaryDepositRetriesAmount = 300
)
func initMorphComponents(c *cfg) {
diff --git a/pkg/local_object_storage/blobstor/fstree/fstree.go b/pkg/local_object_storage/blobstor/fstree/fstree.go
index 08ec75ac..5d7094d4 100644
--- a/pkg/local_object_storage/blobstor/fstree/fstree.go
+++ b/pkg/local_object_storage/blobstor/fstree/fstree.go
@@ -247,9 +247,11 @@ func (t *FSTree) Put(prm common.PutPrm) (common.PutRes, error) {
err = common.ErrNoSpace
_ = os.RemoveAll(tmpPath)
}
+ } else {
+ err = os.Rename(tmpPath, p)
}
- return common.PutRes{StorageID: []byte{}}, os.Rename(tmpPath, p)
+ return common.PutRes{StorageID: []byte{}}, err
}
func (t *FSTree) writeFlags() int {
diff --git a/pkg/local_object_storage/pilorama/boltdb.go b/pkg/local_object_storage/pilorama/boltdb.go
index 4b1a5e95..0f546ef6 100644
--- a/pkg/local_object_storage/pilorama/boltdb.go
+++ b/pkg/local_object_storage/pilorama/boltdb.go
@@ -933,9 +933,3 @@ func internalKey(key []byte, k, v string, parent, node Node) []byte {
key = append(key, raw[:]...)
return key
}
-
-func toUint64(x uint64) []byte {
- var a [8]byte
- binary.LittleEndian.PutUint64(a[:], x)
- return a[:]
-}