Skip to content

Commit

Permalink
warmup metadata when open cache enabled (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexilee authored Feb 8, 2023
1 parent c8ea744 commit 035cec1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/vfs/fill.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func (v *VFS) fillCache(ctx meta.Context, paths []string, concurrent int, count,
if err := v.fillInode(ctx, f.ino, f.size, bytes); err != nil {
logger.Errorf("Inode %d could be corrupted: %s", f.ino, err)
}
if v.Conf.Meta.OpenCache > 0 {
if err := v.Meta.Open(ctx, f.ino, syscall.O_RDONLY, &meta.Attr{}); err != 0 {
logger.Errorf("Inode %d could be opened: %s", f.ino, err)
}
_ = v.Meta.Close(ctx, f.ino)
}
if count != nil {
atomic.AddUint64(count, 1)
}
Expand Down

0 comments on commit 035cec1

Please sign in to comment.