hardlink works now

This commit is contained in:
Chris Lu
2020-09-24 03:06:44 -07:00
parent c7d7b1a0f6
commit 5e239afdfc
16 changed files with 882 additions and 461 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/filer/leveldb"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/util/bounded_tree"
)
@@ -17,7 +16,7 @@ import (
// e.g. fill fileId field for chunks
type MetaCache struct {
localStore filer.FilerStore
localStore filer.VirtualFilerStore
sync.RWMutex
visitedBoundary *bounded_tree.BoundedTree
uidGidMapper *UidGidMapper
@@ -31,7 +30,7 @@ func NewMetaCache(dbFolder string, uidGidMapper *UidGidMapper) *MetaCache {
}
}
func openMetaStore(dbFolder string) filer.FilerStore {
func openMetaStore(dbFolder string) filer.VirtualFilerStore {
os.RemoveAll(dbFolder)
os.MkdirAll(dbFolder, 0755)
@@ -45,7 +44,7 @@ func openMetaStore(dbFolder string) filer.FilerStore {
glog.Fatalf("Failed to initialize metadata cache store for %s: %+v", store.GetName(), err)
}
return store
return filer.NewFilerStoreWrapper(store)
}
@@ -56,7 +55,6 @@ func (mc *MetaCache) InsertEntry(ctx context.Context, entry *filer.Entry) error
}
func (mc *MetaCache) doInsertEntry(ctx context.Context, entry *filer.Entry) error {
filer_pb.BeforeEntrySerialization(entry.Chunks)
return mc.localStore.InsertEntry(ctx, entry)
}
@@ -94,7 +92,6 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
func (mc *MetaCache) UpdateEntry(ctx context.Context, entry *filer.Entry) error {
mc.Lock()
defer mc.Unlock()
filer_pb.BeforeEntrySerialization(entry.Chunks)
return mc.localStore.UpdateEntry(ctx, entry)
}
@@ -106,7 +103,6 @@ func (mc *MetaCache) FindEntry(ctx context.Context, fp util.FullPath) (entry *fi
return nil, err
}
mc.mapIdFromFilerToLocal(entry)
filer_pb.AfterEntryDeserialization(entry.Chunks)
return
}
@@ -126,7 +122,6 @@ func (mc *MetaCache) ListDirectoryEntries(ctx context.Context, dirPath util.Full
}
for _, entry := range entries {
mc.mapIdFromFilerToLocal(entry)
filer_pb.AfterEntryDeserialization(entry.Chunks)
}
return entries, err
}