kubernetes/pkg/volume/util/fsquota/quota_linux.go

var podUidMap

var podQuotaMap

var dirQuotaMap

var quotaPodMap

var dirPodMap

var devApplierMap

var dirApplierMap

var dirApplierLock

var podDirCountMap

var quotaSizeMap

var quotaLock

var supportsQuotasMap

var supportsQuotasLock

var backingDevMap

var backingDevLock

var mountpointMap

var mountpointLock

var providers

// Separate the innards for ease of testing
func detectBackingDevInternal(mountpoint string, mounts string) (string, error) {}

// detectBackingDev assumes that the mount point provided is valid
func detectBackingDev(_ mount.Interface, mountpoint string) (string, error) {}

func clearBackingDev(path string) {}

// Assumes that the path has been fully canonicalized
// Breaking this up helps with testing
func detectMountpointInternal(m mount.Interface, path string) (string, error) {}

func detectMountpoint(m mount.Interface, path string) (string, error) {}

func clearMountpoint(path string) {}

// getFSInfo Returns mountpoint and backing device
// getFSInfo should cache the mountpoint and backing device for the
// path.
func getFSInfo(m mount.Interface, path string) (string, string, error) {}

func clearFSInfo(path string) {}

func getApplier(path string) common.LinuxVolumeQuotaApplier {}

func setApplier(path string, applier common.LinuxVolumeQuotaApplier) {}

func clearApplier(path string) {}

func setQuotaOnDir(path string, id common.QuotaID, bytes int64) error {}

func GetQuotaOnDir(m mount.Interface, path string) (common.QuotaID, error) {}

func clearQuotaOnDir(m mount.Interface, path string, userNamespacesEnabled bool) error {}

// SupportsQuotas -- Does the path support quotas
// Cache the applier for paths that support quotas.  For paths that don't,
// don't cache the result because nothing will clean it up.
// However, do cache the device->applier map; the number of devices
// is bounded.
// User namespaces prevent changes to project IDs on the filesystem,
// ensuring xfs-quota metrics' reliability; hence, userNamespacesEnabled is checked.
func SupportsQuotas(m mount.Interface, path string, userNamespacesEnabled bool) (bool, error) {}

// AssignQuota -- assign a quota to the specified directory.
// AssignQuota chooses the quota ID based on the pod UID and path.
// If the pod UID is identical to another one known, it may (but presently
// doesn't) choose the same quota ID as other volumes in the pod.
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity, userNamespacesEnabled bool) error {}

// GetConsumption -- retrieve the consumption (in bytes) of the directory
func GetConsumption(path string) (*resource.Quantity, error) {}

// GetInodes -- retrieve the number of inodes in use under the directory
func GetInodes(path string) (*resource.Quantity, error) {}

// ClearQuota -- remove the quota assigned to a directory
func ClearQuota(m mount.Interface, path string, userNamespacesEnabled bool) error {}