Skip to content

Commit 576e3c8

Browse files
committed
quota: add build tag to disable it
change backported from Moby. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 1007d6a commit 576e3c8

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

drivers/quota/projectquota.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build linux
1+
// +build linux,!exclude_disk_quota
22

33
//
44
// projectquota.go - implements XFS project quota controls
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// +build linux,exclude_disk_quota
2+
3+
package quota
4+
5+
import (
6+
"github.com/pkg/errors"
7+
)
8+
9+
// Quota limit params - currently we only control blocks hard limit
10+
type Quota struct {
11+
Size uint64
12+
}
13+
14+
// Control - Context to be used by storage driver (e.g. overlay)
15+
// who wants to apply project quotas to container dirs
16+
type Control struct {
17+
}
18+
19+
var (
20+
errQuotaNotSupported = errors.New("filesystem does not support, or has not enabled quotas")
21+
)
22+
23+
func NewControl(basePath string) (*Control, error) {
24+
return nil, errQuotaNotSupported
25+
}
26+
27+
// SetQuota - assign a unique project id to directory and set the quota limits
28+
// for that project id
29+
func (q *Control) SetQuota(targetPath string, quota Quota) error {
30+
return errQuotaNotSupported
31+
}
32+
33+
// GetQuota - get the quota limits of a directory that was configured with SetQuota
34+
func (q *Control) GetQuota(targetPath string, quota *Quota) error {
35+
return errQuotaNotSupported
36+
}

0 commit comments

Comments
 (0)