union: propagate SlowHash feature

This commit is contained in:
Lesmiscore 2022-10-10 12:18:54 +09:00 committed by Nick Craig-Wood
parent 9bf78d0373
commit 6654b66114
1 changed files with 5 additions and 1 deletions

View File

@ -894,18 +894,22 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
WriteMetadata: true,
UserMetadata: true,
}).Fill(ctx, f)
canMove := true
canMove, slowHash := true, false
for _, f := range upstreams {
features = features.Mask(ctx, f) // Mask all upstream fs
if !operations.CanServerSideMove(f) {
canMove = false
}
slowHash = slowHash || f.Features().SlowHash
}
// We can move if all remotes support Move or Copy
if canMove {
features.Move = f.Move
}
// If any of upstreams are SlowHash, propagate it
features.SlowHash = slowHash
// Enable ListR when upstreams either support ListR or is local
// But not when all upstreams are local
if features.ListR == nil {