lxd/storage/quota/projectquota.go
func GetProjectUsage(path string, id uint32) (int64, error) {
	// Get the backing device
	devPath, err := devForPath(path)
	if err != nil {
		return -1, err
	}

	// Call quotactl through CGo
	cDevPath := C.CString(devPath)
	defer C.free(unsafe.Pointer(cDevPath))

	size := C.quota_get_usage(cDevPath, C.uint32_t(id))
	if size < 0 {
		return -1, fmt.Errorf("Failed to get project consumption for id '%d' on '%s'", id, path)
	}

	return int64(size), nil
}
func GetProjectUsage(path string, id uint32) (int64, error) {
	// Get the backing device
	devPath, err := devForPath(path)
	if err != nil {
		return -1, err
	}

	// Call quotactl through CGo
	cDevPath := C.CString(devPath)
	defer C.free(unsafe.Pointer(cDevPath))

	size := C.quota_get_usage(cDevPath, C.uint32_t(id))
	if size < 0 {
		return -1, fmt.Errorf("Failed to get project consumption for id '%d' on '%s'", id, path)
	}

	return int64(size), nil
}
// GetProjectUsage returns the current consumption