mirror of
https://github.com/containers/podman.git
synced 2025-09-28 09:15:26 +08:00
Bump github.com/containers/storage from 1.29.0 to 1.30.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.29.0 to 1.30.0. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.29.0...v1.30.0) Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
44
vendor/github.com/containers/storage/drivers/btrfs/btrfs.go
generated
vendored
44
vendor/github.com/containers/storage/drivers/btrfs/btrfs.go
generated
vendored
@ -88,7 +88,7 @@ func Init(home string, options graphdriver.Options) (graphdriver.Driver, error)
|
||||
}
|
||||
|
||||
if userDiskQuota {
|
||||
if err := driver.subvolEnableQuota(); err != nil {
|
||||
if err := driver.enableQuota(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@ -159,10 +159,6 @@ func (d *Driver) Metadata(id string) (map[string]string, error) {
|
||||
|
||||
// Cleanup unmounts the home directory.
|
||||
func (d *Driver) Cleanup() error {
|
||||
if err := d.subvolDisableQuota(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return mount.Unmount(d.home)
|
||||
}
|
||||
|
||||
@ -320,7 +316,7 @@ func (d *Driver) updateQuotaStatus() {
|
||||
d.once.Do(func() {
|
||||
if !d.quotaEnabled {
|
||||
// In case quotaEnabled is not set, check qgroup and update quotaEnabled as needed
|
||||
if err := subvolQgroupStatus(d.home); err != nil {
|
||||
if err := qgroupStatus(d.home); err != nil {
|
||||
// quota is still not enabled
|
||||
return
|
||||
}
|
||||
@ -329,7 +325,7 @@ func (d *Driver) updateQuotaStatus() {
|
||||
})
|
||||
}
|
||||
|
||||
func (d *Driver) subvolEnableQuota() error {
|
||||
func (d *Driver) enableQuota() error {
|
||||
d.updateQuotaStatus()
|
||||
|
||||
if d.quotaEnabled {
|
||||
@ -355,32 +351,6 @@ func (d *Driver) subvolEnableQuota() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Driver) subvolDisableQuota() error {
|
||||
d.updateQuotaStatus()
|
||||
|
||||
if !d.quotaEnabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
dir, err := openDir(d.home)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closeDir(dir)
|
||||
|
||||
var args C.struct_btrfs_ioctl_quota_ctl_args
|
||||
args.cmd = C.BTRFS_QUOTA_CTL_DISABLE
|
||||
_, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QUOTA_CTL,
|
||||
uintptr(unsafe.Pointer(&args)))
|
||||
if errno != 0 {
|
||||
return fmt.Errorf("Failed to disable btrfs quota for %s: %v", dir, errno.Error())
|
||||
}
|
||||
|
||||
d.quotaEnabled = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Driver) subvolRescanQuota() error {
|
||||
d.updateQuotaStatus()
|
||||
|
||||
@ -423,11 +393,11 @@ func subvolLimitQgroup(path string, size uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// subvolQgroupStatus performs a BTRFS_IOC_TREE_SEARCH on the root path
|
||||
// qgroupStatus performs a BTRFS_IOC_TREE_SEARCH on the root path
|
||||
// with search key of BTRFS_QGROUP_STATUS_KEY.
|
||||
// In case qgroup is enabled, the returned key type will match BTRFS_QGROUP_STATUS_KEY.
|
||||
// For more details please see https://github.com/kdave/btrfs-progs/blob/v4.9/qgroup.c#L1035
|
||||
func subvolQgroupStatus(path string) error {
|
||||
func qgroupStatus(path string) error {
|
||||
dir, err := openDir(path)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -603,7 +573,7 @@ func (d *Driver) setStorageSize(dir string, driver *Driver) error {
|
||||
return fmt.Errorf("btrfs: storage size cannot be less than %s", units.HumanSize(float64(d.options.minSpace)))
|
||||
}
|
||||
|
||||
if err := d.subvolEnableQuota(); err != nil {
|
||||
if err := d.enableQuota(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -674,7 +644,7 @@ func (d *Driver) Get(id string, options graphdriver.MountOpts) (string, error) {
|
||||
|
||||
if quota, err := ioutil.ReadFile(d.quotasDirID(id)); err == nil {
|
||||
if size, err := strconv.ParseUint(string(quota), 10, 64); err == nil && size >= d.options.minSpace {
|
||||
if err := d.subvolEnableQuota(); err != nil {
|
||||
if err := d.enableQuota(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := subvolLimitQgroup(dir, size); err != nil {
|
||||
|
Reference in New Issue
Block a user