Skip to content

Commit

Permalink
Migrate DisableParallelDirops to new config.
Browse files Browse the repository at this point in the history
  • Loading branch information
kislaykishore committed Jul 6, 2024
1 parent 0ab44ec commit 628b8e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ be interacting with the file system.`)
// users experience the performance gains. E.g. if a user workload tries to
// access two files under same directory parallely, then the lookups also
// happen parallely.
EnableParallelDirOps: !(mountConfig.FileSystemConfig.DisableParallelDirops),
EnableParallelDirOps: !(newConfig.FileSystem.DisableParallelDirops),
}

mountCfg.ErrorLogger = logger.NewLegacyLogger(logger.LevelError, "fuse: ")
Expand Down
2 changes: 1 addition & 1 deletion internal/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ func (fs *fileSystem) lookUpOrCreateChildInode(
// Set up a function that will find a lookup result for the child with the
// given name. Expects no locks to be held.
getLookupResult := func() (*inode.Core, error) {
if fs.mountConfig.FileSystemConfig.DisableParallelDirops {
if fs.newConfig.FileSystem.DisableParallelDirops {
parent.Lock()
defer parent.Unlock()
} else {
Expand Down
10 changes: 5 additions & 5 deletions internal/fs/parallel_dirops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sync"
"testing"

"github.com/googlecloudplatform/gcsfuse/v2/internal/config"
"github.com/googlecloudplatform/gcsfuse/v2/cfg"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand All @@ -42,8 +42,8 @@ type ParallelDiropsWithoutCachesTest struct {

func (t *ParallelDiropsTest) SetupSuite() {
t.serverCfg.ImplicitDirectories = true
t.serverCfg.MountConfig = &config.MountConfig{
FileSystemConfig: config.FileSystemConfig{
t.serverCfg.NewConfig = &cfg.Config{
FileSystem: cfg.FileSystemConfig{
DisableParallelDirops: false,
}}
t.serverCfg.RenameDirLimit = 10
Expand All @@ -52,8 +52,8 @@ func (t *ParallelDiropsTest) SetupSuite() {

func (t *ParallelDiropsWithoutCachesTest) SetupSuite() {
t.serverCfg.ImplicitDirectories = true
t.serverCfg.MountConfig = &config.MountConfig{
FileSystemConfig: config.FileSystemConfig{
t.serverCfg.NewConfig = &cfg.Config{
FileSystem: cfg.FileSystemConfig{
DisableParallelDirops: false,
}}
t.serverCfg.RenameDirLimit = 10
Expand Down

0 comments on commit 628b8e3

Please sign in to comment.