Skip to content

Commit a7a6b09

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 a7a6b09

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
func NewControl(basePath string) (*Control, error) {
20+
return nil, errors.New("filesystem does not support, or has not enabled quotas")
21+
}
22+
23+
// SetQuota - assign a unique project id to directory and set the quota limits
24+
// for that project id
25+
func (q *Control) SetQuota(targetPath string, quota Quota) error {
26+
return errors.New("filesystem does not support, or has not enabled quotas")
27+
}
28+
29+
// GetQuota - get the quota limits of a directory that was configured with SetQuota
30+
func (q *Control) GetQuota(targetPath string, quota *Quota) error {
31+
return errors.New("filesystem does not support, or has not enabled quotas")
32+
}

0 commit comments

Comments
 (0)