quota

package
v1.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	// contains filtered or unexported fields
}

Control - Context to be used by storage driver (e.g. overlay) who wants to apply project quotas to container dirs

func NewControl

func NewControl(basePath string) (*Control, error)

Then try to create a test directory with the next project id and set a quota on it. If that works, continue to scan existing containers to map allocated project ids.

func (*Control) ClearQuota added in v0.46.1

func (q *Control) ClearQuota(targetPath string)

ClearQuota removes the map entry in the quotas map for targetPath. It does so to prevent the map leaking entries as directories are deleted.

func (*Control) GetDiskUsage added in v0.46.1

func (q *Control) GetDiskUsage(targetPath string, usage *directory.DiskUsage) error

GetDiskUsage - get the current disk usage of a directory that was configured with SetQuota

func (*Control) GetQuota

func (q *Control) GetQuota(targetPath string, quota *Quota) error

GetQuota - get the quota limits of a directory that was configured with SetQuota

func (*Control) SetQuota

func (q *Control) SetQuota(targetPath string, quota Quota) error

SetQuota - assign a unique project id to directory and set the quota limits for that project id

type Quota

type Quota struct {
	Size   uint64
	Inodes uint64
}

Quota limit params - currently we only control blocks hard limit and inodes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL