fsquota

package
v0.0.0-...-0f8ce4c Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fsquota provides a simplified interface to interact with Linux's filesystem qouta API. It only supports setting quotas on directories, not groups or users. Quotas need to be already enabled on the filesystem to be able to use them using this package. See the quotactl package if you intend to use this on a filesystem where quotas need to be enabled manually.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetQuota

func SetQuota(path string, maxBytes uint64, maxInodes uint64) error

SetQuota sets the quota of bytes and/or inodes in a given path. To not set a limit, set the corresponding argument to zero. Setting both arguments to zero removes the quota entirely. This function can only be called on an empty directory. It can't be used to create a quota below a directory which already has a quota since Linux doesn't offer hierarchical quotas.

Types

type Quota

type Quota struct {
	Bytes      uint64
	BytesUsed  uint64
	Inodes     uint64
	InodesUsed uint64
}

func GetQuota

func GetQuota(path string) (*Quota, error)

GetQuota returns the current active quota and its utilization at the given path

Directories

Path Synopsis
Package quotactl implements a low-level wrapper around the modern portion of Linux's quotactl() syscall.
Package quotactl implements a low-level wrapper around the modern portion of Linux's quotactl() syscall.

Jump to

Keyboard shortcuts

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