Skip to content

Commit

Permalink
Merge pull request #1214 from mtrmac/overlay-locker
Browse files Browse the repository at this point in the history
Remove locker.Locker from drivers/overlay
  • Loading branch information
rhatdan committed Apr 22, 2022
2 parents 4899f82 + abd44d3 commit 8996869
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions drivers/overlay/overlay.go
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/containers/storage/pkg/directory"
"github.com/containers/storage/pkg/fsutils"
"github.com/containers/storage/pkg/idtools"
"github.com/containers/storage/pkg/locker"
"github.com/containers/storage/pkg/mount"
"github.com/containers/storage/pkg/parsers"
"github.com/containers/storage/pkg/system"
Expand Down Expand Up @@ -119,7 +118,6 @@ type Driver struct {
supportsDType bool
supportsVolatile *bool
usingMetacopy bool
locker *locker.Locker

supportsIDMappedMounts *bool
}
Expand Down Expand Up @@ -422,7 +420,6 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
supportsDType: supportsDType,
usingMetacopy: usingMetacopy,
supportsVolatile: supportsVolatile,
locker: locker.New(),
options: *opts,
}

Expand Down Expand Up @@ -1175,9 +1172,6 @@ func (d *Driver) optsAppendMappings(opts string, uidMaps, gidMaps []idtools.IDMa

// Remove cleans the directories that are created for this id.
func (d *Driver) Remove(id string) error {
d.locker.Lock(id)
defer d.locker.Unlock(id)

dir := d.dir(id)
lid, err := ioutil.ReadFile(path.Join(dir, "link"))
if err == nil {
Expand Down Expand Up @@ -1311,8 +1305,6 @@ func (d *Driver) Get(id string, options graphdriver.MountOpts) (_ string, retErr
}

func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountOpts) (_ string, retErr error) {
d.locker.Lock(id)
defer d.locker.Unlock(id)
dir, inAdditionalStore := d.dir2(id)
if _, err := os.Stat(dir); err != nil {
return "", err
Expand Down Expand Up @@ -1637,8 +1629,6 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO

// Put unmounts the mount path created for the give id.
func (d *Driver) Put(id string) error {
d.locker.Lock(id)
defer d.locker.Unlock(id)
dir := d.dir(id)
if _, err := os.Stat(dir); err != nil {
return err
Expand Down

0 comments on commit 8996869

Please sign in to comment.