mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #20003 from liubogithub/btrfs
Graphdriver/btrfs: Avoid using single d.Get()
This commit is contained in:
commit
25941b5020
1 changed files with 5 additions and 1 deletions
|
@ -256,10 +256,14 @@ func (d *Driver) Create(id, parent, mountLabel string) error {
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
parentDir, err := d.Get(parent, "")
|
||||
parentDir := d.subvolumesDirID(parent)
|
||||
st, err := os.Stat(parentDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !st.IsDir() {
|
||||
return fmt.Errorf("%s: not a direcotory", parentDir)
|
||||
}
|
||||
if err := subvolSnapshot(parentDir, subvolumes, id); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue