resfsdir

package
v3.0.0-rc49 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) 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) 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) 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