From 56ff8ccc91f9e524cc835e2df7d91473187129d1 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Sun, 2 Jun 2019 12:18:58 -0700 Subject: [PATCH] quota: add noncgo build tag Signed-off-by: Tonis Tiigi (cherry picked from commit 186cd7cf4a4d3a02ca7e7a18d6d923245f3187b0) Signed-off-by: Kir Kolyshkin --- daemon/graphdriver/quota/projectquota.go | 15 +-------------- .../quota/projectquota_unsupported.go | 18 ++++++++++++++++++ daemon/graphdriver/quota/types.go | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 daemon/graphdriver/quota/projectquota_unsupported.go create mode 100644 daemon/graphdriver/quota/types.go diff --git a/daemon/graphdriver/quota/projectquota.go b/daemon/graphdriver/quota/projectquota.go index eb489ac9f7..fbd53085c9 100644 --- a/daemon/graphdriver/quota/projectquota.go +++ b/daemon/graphdriver/quota/projectquota.go @@ -1,4 +1,4 @@ -// +build linux +// +build linux,!exclude_disk_quota // // projectquota.go - implements XFS project quota controls @@ -63,19 +63,6 @@ import ( "golang.org/x/sys/unix" ) -// Quota limit params - currently we only control blocks hard limit -type Quota struct { - Size uint64 -} - -// Control - Context to be used by storage driver (e.g. overlay) -// who wants to apply project quotas to container dirs -type Control struct { - backingFsBlockDev string - nextProjectID uint32 - quotas map[string]uint32 -} - // NewControl - initialize project quota support. // Test to make sure that quota can be set on a test dir and find // the first project id to be used for the next container create. diff --git a/daemon/graphdriver/quota/projectquota_unsupported.go b/daemon/graphdriver/quota/projectquota_unsupported.go new file mode 100644 index 0000000000..7422d5b432 --- /dev/null +++ b/daemon/graphdriver/quota/projectquota_unsupported.go @@ -0,0 +1,18 @@ +// +build linux,exclude_disk_quota + +package quota // import "github.com/docker/docker/daemon/graphdriver/quota" + +func NewControl(basePath string) (*Control, error) { + return nil, ErrQuotaNotSupported +} + +// SetQuota - assign a unique project id to directory and set the quota limits +// for that project id +func (q *Control) SetQuota(targetPath string, quota Quota) error { + return ErrQuotaNotSupported +} + +// GetQuota - get the quota limits of a directory that was configured with SetQuota +func (q *Control) GetQuota(targetPath string, quota *Quota) error { + return ErrQuotaNotSupported +} diff --git a/daemon/graphdriver/quota/types.go b/daemon/graphdriver/quota/types.go new file mode 100644 index 0000000000..90f71520a7 --- /dev/null +++ b/daemon/graphdriver/quota/types.go @@ -0,0 +1,16 @@ +// +build linux + +package quota // import "github.com/docker/docker/daemon/graphdriver/quota" + +// Quota limit params - currently we only control blocks hard limit +type Quota struct { + Size uint64 +} + +// Control - Context to be used by storage driver (e.g. overlay) +// who wants to apply project quotas to container dirs +type Control struct { + backingFsBlockDev string + nextProjectID uint32 + quotas map[string]uint32 +}