From 962bb2125197c1a3217dc5151dc7b61a8dd69c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 7 May 2026 12:04:35 +0200 Subject: [PATCH] Expose WarmuIDCache, it's gonna be used by a "scan" command later --- pkg/storage/fs/posix/posix.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/storage/fs/posix/posix.go b/pkg/storage/fs/posix/posix.go index ed807f9015..276ec1c8d9 100644 --- a/pkg/storage/fs/posix/posix.go +++ b/pkg/storage/fs/posix/posix.go @@ -58,7 +58,8 @@ func init() { type posixFS struct { storage.FS - um usermapper.Mapper + tree *tree.Tree + um usermapper.Mapper } // New returns an implementation to of the storage.FS interface that talk to @@ -215,11 +216,17 @@ func New(o *options.Options, stream events.Stream, cache, historyCache *idcache. mw := middleware.NewFS(dfs, hooks...) fs.FS = mw + fs.tree = tp fs.um = um return fs, nil } +// WarmupIDCache allows triggering a posix fs scan and id cache warmup manually. +func (fs *posixFS) WarmupIDCache(root string, assimilate, onlyDirty bool) error { + return fs.tree.WarmupIDCache(root, assimilate, onlyDirty) +} + // ListUploadSessions returns the upload sessions matching the given filter func (fs *posixFS) ListUploadSessions(ctx context.Context, filter storage.UploadSessionFilter) ([]storage.UploadSession, error) { return fs.FS.(storage.UploadSessionLister).ListUploadSessions(ctx, filter)