Skip to content

Commit

Permalink
Merge pull request moby#24801 from anusha-ragunathan/plugin-lookup
Browse files Browse the repository at this point in the history
Remove extra map lookup for volume drivers.
  • Loading branch information
thaJeztah authored Jul 19, 2016
2 parents 2ee828a + 5d46273 commit 4498214
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions volume/drivers/extpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,15 @@ func lookup(name string) (volume.Driver, error) {
return nil, fmt.Errorf("Error looking up volume plugin %s: %v", name, err)
}

drivers.Lock()
defer drivers.Unlock()
if ext, ok := drivers.extensions[name]; ok {
return ext, nil
}

d := NewVolumeDriver(name, p.Client())
if err := validateDriver(d); err != nil {
return nil, err
}

if p.IsLegacy() {
drivers.Lock()
drivers.extensions[name] = d
drivers.Unlock()
}
return d, nil
}
Expand Down

0 comments on commit 4498214

Please sign in to comment.