fs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseTempDirLimitNumFiles

func ChooseTempDirLimitNumFiles() (limit int)

Choose a reasonable value for ServerConfig.TempDirLimitNumFiles based on process limits.

func NewServer

func NewServer(cfg *ServerConfig) (server fuse.Server, err error)

Create a fuse file system server according to the supplied configuration.

Types

type GenerationBackedInode

type GenerationBackedInode interface {
	inode.Inode
	SourceGeneration() int64
}

A common interface for inodes backed by particular object generations. Implemented by FileInode and SymlinkInode.

type ServerConfig

type ServerConfig struct {
	// A clock used for modification times and cache expiration.
	Clock timeutil.Clock

	// The bucket that the file system is to export.
	Bucket gcs.Bucket

	// The temporary directory to use for local caching, or the empty string to
	// use the system default.
	TempDir string

	// A desired limit on the number of open files used for storing temporary
	// object contents. May not be obeyed if there is a large number of dirtied
	// files that have not been flushed or closed.
	//
	// Most users will want to use ChooseTempDirLimitNumFiles to choose this.
	TempDirLimitNumFiles int

	// A desired limit on temporary space usage, in bytes. May not be obeyed if
	// there is a large volume of dirtied files that have not been flushed or
	// closed.
	TempDirLimitBytes int64

	// If set to a non-zero value N, the file system will read objects from GCS a
	// chunk at a time with a maximum read size of N, caching each chunk
	// independently. The part about separate caching does not apply to dirty
	// files, for which the entire contents will be in the temporary directory
	// regardless of this setting.
	GCSChunkSize uint64

	// By default, if a bucket contains the object "foo/bar" but no object named
	// "foo/", it's as if the directory doesn't exist. This allows us to have
	// non-flaky name resolution code.
	//
	// Setting this bool to true enables a mode where object listings are
	// consulted to allow for the directory in the situation above to exist. Note
	// that this has drawbacks in the form of name resolution flakiness and
	// surprising behavior.
	//
	// See docs/semantics.md for more info.
	ImplicitDirectories bool

	// By default, the file system will always show nlink == 1 for every inode,
	// regardless of whether its backing object has been deleted or overwritten.
	//
	// Setting SupportNlink to true causes the file system to respond to fuse
	// getattr requests with nlink == 0 for file inodes in the cases mentioned
	// above. This requires a round trip to GCS for every getattr, which can be
	// quite slow.
	SupportNlink bool

	// If non-zero, each directory will maintain a cache from child name to
	// information about whether that name exists as a file and/or directory.
	// This may speed up calls to look up and stat inodes, especially when
	// combined with a stat-caching GCS bucket, but comes at the cost of
	// consistency: if the child is removed and recreated with a different type
	// before the expiration, we may fail to find it.
	DirTypeCacheTTL time.Duration

	// The UID and GID that owns all inodes in the file system.
	Uid uint32
	Gid uint32

	// Permissions bits to use for files and directories. No bits outside of
	// os.ModePerm may be set.
	FilePerms os.FileMode
	DirPerms  os.FileMode
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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