mount

package
v2.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP1 ClientProtocol = "http1"
	HTTP2 ClientProtocol = "http2"
	// DefaultStatOrTypeCacheTTL is the default value used for
	// stat-cache-ttl or type-cache-ttl if they have not been set
	// by the user.
	DefaultStatOrTypeCacheTTL time.Duration = time.Minute
	// DefaultStatCacheCapacity is the default value for stat-cache-capacity.
	// This is equivalent of setting metadata-cache: stat-cache-max-size-mb.
	DefaultStatCacheCapacity = 20460
	// DefaultStatCacheMaxSizeMB is the default for stat-cache-max-size-mb
	// and is to be used when neither stat-cache-max-size-mb nor
	// stat-cache-capacity is set.
	DefaultStatCacheMaxSizeMB = 32
	// AverageSizeOfPositiveStatCacheEntry is the assumed size of each positive stat-cache-entry,
	// meant for two purposes.
	// 1. for conversion from stat-cache-capacity to stat-cache-max-size-mb.
	// 2. internal testing.
	AverageSizeOfPositiveStatCacheEntry uint64 = 1400
	// AverageSizeOfNegativeStatCacheEntry is the assumed size of each negative stat-cache-entry,
	// meant for two purposes..
	// 1. for conversion from stat-cache-capacity to stat-cache-max-size-mb.
	// 2. internal testing.
	AverageSizeOfNegativeStatCacheEntry uint64 = 240
)

Variables

This section is empty.

Functions

func ParseOptions

func ParseOptions(m map[string]string, s string)

ParseOptions parse an option string in the format accepted by mount(8) and generated for its external mount helpers.

It is assumed that option name and values do not contain commas, and that the first equals sign in an option is the name/value separator. There is no support for escaping.

For example, if the input is

user,foo=bar=baz,qux

then the following will be inserted into the map.

"user": "",
"foo": "bar=baz",
"qux": "",

func ResolveMetadataCacheTTL

func ResolveMetadataCacheTTL(statCacheTTL, typeCacheTTL time.Duration, ttlInSeconds int64) (metadataCacheTTL time.Duration)

ResolveMetadataCacheTTL returns the ttl to be used for stat/type cache based on the user flags/configs.

func ResolveStatCacheMaxSizeMB

func ResolveStatCacheMaxSizeMB(mountConfigStatCacheMaxSizeMB int64, flagStatCacheCapacity int) (statCacheMaxSizeMB uint64, err error)

ResolveStatCacheMaxSizeMB returns the stat-cache size in MiBs based on the user old and new flags/configs.

Types

type ClientProtocol

type ClientProtocol string

func (ClientProtocol) IsValid

func (cp ClientProtocol) IsValid() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL