From effa00ed0861a9f6b774e4413a44fd96b6604667 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 26 Nov 2020 11:21:58 -0800 Subject: [PATCH] refactor --- weed/filer/filer.go | 8 -------- weed/filer/filer_deletion.go | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/weed/filer/filer.go b/weed/filer/filer.go index 5510645cd..2dec1afbf 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -317,11 +317,3 @@ func (f *Filer) Shutdown() { f.LocalMetaLogBuffer.Shutdown() f.Store.Shutdown() } - -func (f *Filer) maybeDeleteHardLinks(hardLinkIds []HardLinkId) { - for _, hardLinkId := range hardLinkIds { - if err := f.Store.DeleteHardLink(context.Background(), hardLinkId); err != nil { - glog.Errorf("delete hard link id %d : %v", hardLinkId, err) - } - } -} diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go index 9eee38277..b87d88d0b 100644 --- a/weed/filer/filer_deletion.go +++ b/weed/filer/filer_deletion.go @@ -1,6 +1,7 @@ package filer import ( + "context" "strings" "time" @@ -151,3 +152,11 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) { } f.DeleteChunks(toDelete) } + +func (f *Filer) maybeDeleteHardLinks(hardLinkIds []HardLinkId) { + for _, hardLinkId := range hardLinkIds { + if err := f.Store.DeleteHardLink(context.Background(), hardLinkId); err != nil { + glog.Errorf("delete hard link id %d : %v", hardLinkId, err) + } + } +}