resfsdir

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupDirectory holds the directory the resource creates. It has the
	// order of the device group of the filesystems mounted, which says
	// what they are too.
	GroupDirectory = keywords.Group{
		ID:    "directory",
		Name:  "Directory",
		Text:  keywords.NewText(fs, "text/group/directory"),
		Order: 10,
	}

	// GroupSize holds the project quota bounding what the directory
	// holds. It has the id, name and order of the size group of the
	// filesystems mounted.
	GroupSize = keywords.Group{
		ID:    "size",
		Name:  "Size",
		Text:  keywords.NewText(fs, "text/group/size"),
		Order: 28,
	}
)

The groups of the keywords of a directory beside the ones of the datarecv keywords, which hold its owner and permissions and the files installed in it.

Functions

func New

func New() resource.Driver

Types

type T

type T struct {
	resource.T
	resource.Restart
	datarecv.DataRecv
	Path      naming.Path `json:"-"`
	DirPath   string      `json:"path"`
	Size      *int64      `json:"size"`
	ProjectID int         `json:"project_id"`
}

func (*T) CanInstall

func (t *T) CanInstall(ctx context.Context) (bool, error)

func (*T) Configure

func (t *T) Configure() error

Configure installs a resource backpointer in the DataStoreInstall

func (*T) CurrentSize

func (t *T) CurrentSize(ctx context.Context) (int64, error)

CurrentSize implements resource.Sizer.

A directory given a size of its own reports what its project quota lets it hold. One without has no size of its own: what it may hold is what the filesystem holding it has, which is what a directory pool reports as the usage of the volumes it serves.

func (*T) DriverID

func (t *T) DriverID() driver.ID

func (*T) Head

func (t *T) Head() string

Head returns the path of the directory on the node, whether the volume it is in is available or not, and empty when the path names nothing.

func (*T) Holds

func (t *T) Holds(src resource.HoldSource) []resource.Hold

Holds says the directory, as a mount point is: another object mounting on it, or managing it, would take it. A directory in a volume, written volume#<n>:/<path> or <vol name>/<path>, is held by the volume.

func (*T) Label

func (t *T) Label(_ context.Context) string

func (*T) Manifest

func (t *T) Manifest() *manifest.T

Manifest exposes to the core the input expected by the driver.

func (*T) PoolCharge

func (t *T) PoolCharge() (string, int64)

Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource PoolCharge implements resource.PoolCharger. A directory takes of the directory it is made in, and takes the size it is bounded to.

A directory with no size is bounded by nothing, and what it takes is not a number anything can be rationed by.

func (*T) ProjectQuotaUsage

func (t *T) ProjectQuotaUsage(ctx context.Context) (used, hard int64, ok bool, err error)

ProjectQuotaUsage implements resource.ProjectQuotaUser: what the project quota of the directory counts, and bounds it to, ok false for a directory with no size of its own.

func (*T) Provision

func (t *T) Provision(ctx context.Context) error

func (*T) Provisioned

func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)

func (*T) Resize

func (t *T) Resize(ctx context.Context, to int64) error

Resize implements resource.Resizer.

func (*T) ResizeHandsOut

func (t *T) ResizeHandsOut(_ context.Context) (func(below int64) int64, error)

ResizeHandsOut implements resource.ResizeHandsOuter.

A quota is a limit, not an allocation, so no resource of a chain is below it: it is the bottom, and is asked for the size a chain is given. It hands out what it is given.

func (*T) ResizePlan

func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)

ResizePlan implements resource.Resizer.

A quota is a limit, not an allocation, so there is nothing below to ask anything of. It is also why a shrink is checked here: lowering a limit under what the tree already holds does not fail, it silently breaks the next write, so it is refused while the chain is still being planned.

func (*T) SizeInfoKey

func (t *T) SizeInfoKey() string

SizeInfoKey implements resource.SizeInfoKeyer.

A directory given a size of its own reports it as a size. One without takes the size of the filesystem holding it, and calling that "size" next to "driver fs.directory" reads as the size of the directory.

func (*T) Start

func (t *T) Start(ctx context.Context) error

func (*T) Status

func (t *T) Status(ctx context.Context) status.T

func (*T) Stop

func (t *T) Stop(ctx context.Context) error

func (*T) Unprovision

func (t *T) Unprovision(ctx context.Context) error

func (*T) UnprovisionAsLeader

func (t *T) UnprovisionAsLeader(ctx context.Context) error

UnprovisionAsLeader removes the directory, which is what provisioning it made. The provision keyword set to false is how an owner keeps a directory that om3 is only to create and never to remove.

A quota-backed directory has its project limit dropped with it, or the filesystem keeps a limit on a project nothing is stamped with any more.

Jump to

Keyboard shortcuts

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