-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue where compiling containers-storage with exclude_disk_qu…
…ota enabled on the Linux CGO platform results in an error indicating that d.quotaCtl.GetDiskUsage is not defined. Signed-off-by: Shi Xue <shixue@cestc.com> Fix the issue where compiling containers-storage with exclude_disk_quota enabled on the Linux CGO platform results in an error indicating that d.quotaCtl.GetDiskUsage is not defined. Signed-off-by: Shi Xue <shixue@cestc.com>
- Loading branch information
Shi Xue
authored and
Shi Yixue
committed
Jun 23, 2024
1 parent
9a0bef0
commit 2c00a5c
Showing
3 changed files
with
20 additions
and
12 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
drivers/overlay/overlay_cgo.go → drivers/overlay/overlay_disk_quota.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build linux && (!cgo || exclude_disk_quota) | ||
// +build linux | ||
// +build !cgo exclude_disk_quota | ||
|
||
package overlay | ||
|
||
import ( | ||
"path" | ||
|
||
"github.com/containers/storage/pkg/directory" | ||
) | ||
|
||
// ReadWriteDiskUsage returns the disk usage of the writable directory for the ID. | ||
// For Overlay, it attempts to check the XFS quota for size, and falls back to | ||
// finding the size of the "diff" directory. | ||
func (d *Driver) ReadWriteDiskUsage(id string) (*directory.DiskUsage, error) { | ||
return directory.Usage(path.Join(d.dir(id), "diff")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters