summaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/grpc/internal/grpcrand
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-10-15 13:14:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-10-18 14:44:10 -0400
commit087f8fc73bec664a30dcf0757cd3cb44ea150582 (patch)
treeb2a04eb4de47d044c6644dcc2da366935a0f9214 /vendor/google.golang.org/grpc/internal/grpcrand
parente0ffc431fe7f016124fdcb36819698a90fe448a9 (diff)
downloadpodman-087f8fc73bec664a30dcf0757cd3cb44ea150582.tar.gz
podman-087f8fc73bec664a30dcf0757cd3cb44ea150582.tar.bz2
podman-087f8fc73bec664a30dcf0757cd3cb44ea150582.zip
Allow API to specify size and inode quota
Fixes: https://github.com/containers/podman/issues/11016 [NO NEW TESTS NEEDED] We have no easy way to tests this in CI/CD systems. Requires quota to be setup on directories to work. Fixes: https://github.com/containers/podman/issues/11016 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/google.golang.org/grpc/internal/grpcrand')
-rw-r--r--vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go29
1 files changed, 20 insertions, 9 deletions
diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
index 200b115ca..740f83c2b 100644
--- a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
+++ b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go
@@ -31,26 +31,37 @@ var (
mu sync.Mutex
)
+// Int implements rand.Int on the grpcrand global source.
+func Int() int {
+ mu.Lock()
+ defer mu.Unlock()
+ return r.Int()
+}
+
// Int63n implements rand.Int63n on the grpcrand global source.
func Int63n(n int64) int64 {
mu.Lock()
- res := r.Int63n(n)
- mu.Unlock()
- return res
+ defer mu.Unlock()
+ return r.Int63n(n)
}
// Intn implements rand.Intn on the grpcrand global source.
func Intn(n int) int {
mu.Lock()
- res := r.Intn(n)
- mu.Unlock()
- return res
+ defer mu.Unlock()
+ return r.Intn(n)
}
// Float64 implements rand.Float64 on the grpcrand global source.
func Float64() float64 {
mu.Lock()
- res := r.Float64()
- mu.Unlock()
- return res
+ defer mu.Unlock()
+ return r.Float64()
+}
+
+// Uint64 implements rand.Uint64 on the grpcrand global source.
+func Uint64() uint64 {
+ mu.Lock()
+ defer mu.Unlock()
+ return r.Uint64()
}