Remove blob size cache from restic mount

This commit is contained in:
greatroar
2020-06-14 12:49:39 +02:00
parent 5d8d70542f
commit 07da61baee
6 changed files with 16 additions and 62 deletions

View File

@@ -9,8 +9,6 @@ import (
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/restic"
"golang.org/x/net/context"
"bazil.org/fuse/fs"
)
@@ -25,12 +23,11 @@ type Config struct {
// Root is the root node of the fuse mount of a repository.
type Root struct {
repo restic.Repository
cfg Config
inode uint64
snapshots restic.Snapshots
blobCache *blobCache
blobSizeCache *BlobSizeCache
repo restic.Repository
cfg Config
inode uint64
snapshots restic.Snapshots
blobCache *blobCache
snCount int
lastCheck time.Time
@@ -50,15 +47,14 @@ const rootInode = 1
const blobCacheSize = 64 << 20
// NewRoot initializes a new root node from a repository.
func NewRoot(ctx context.Context, repo restic.Repository, cfg Config) *Root {
func NewRoot(repo restic.Repository, cfg Config) *Root {
debug.Log("NewRoot(), config %v", cfg)
root := &Root{
repo: repo,
inode: rootInode,
cfg: cfg,
blobCache: newBlobCache(blobCacheSize),
blobSizeCache: NewBlobSizeCache(ctx, repo.Index()),
repo: repo,
inode: rootInode,
cfg: cfg,
blobCache: newBlobCache(blobCacheSize),
}
if !cfg.OwnerIsRoot {