func (r *regulator) GetContent(ctx context.Context, path string) ([]byte, error) {
	r.enter()
	defer r.exit()
	return r.StorageDriver.GetContent(ctx, path)
}
GetContent retrieves the content stored at "path" as a []byte.
This should primarily be used for small objects.
package base
import (
	"io"
	"sync"
	"github.com/docker/distribution/context"
	storagedriver "github.com/docker/distribution/registry/storage/driver"
)
type regulator struct {
	storagedriver.StorageDriver
	*sync.Cond
	available uint64
}
func NewRegulator(driver storagedriver.StorageDriver, limit uint64) storagedriver.StorageDriver {
	return &regulator{
		StorageDriver: driver,
		Cond:          sync.NewCond(&sync.Mutex{}),
		available:     limit,
	}
}
func (r *regulator) enter() {
	r.L.Lock()
	for r.available == 0 {
		r.Wait()
	}
	r.available--
	r.L.Unlock()
}
func (r *regulator) exit() {
	r.L.Lock()
	if r.available == 0 {
		r.Signal()
	}
	r.available++
	r.L.Unlock()
}
func (r *regulator) Name() string {
	r.enter()
	defer r.exit()
	return r.StorageDriver.Name()
}