Documentation
¶
Index ¶
- Variables
- func CanFSCK(fs any) error
- func DevicesFSCK(ctx context.Context, fs any, dl subDeviceLister) error
- func DevicesFormated(ctx context.Context, fs any, dl subDeviceLister) (bool, error)
- func HasFSCK(fs any) bool
- func IsCapable(ctx context.Context, t string) bool
- func Types() []string
- type BTRFS
- func (t BTRFS) Devices(ctx context.Context, dev string) ([]string, error)
- func (t BTRFS) Grow(ctx context.Context, dev, mountPoint string) error
- func (t BTRFS) IsCapable() bool
- func (t BTRFS) IsFormated(ctx context.Context, dev string) (bool, error)
- func (t BTRFS) MKFS(ctx context.Context, dev string, args []string) error
- func (t BTRFS) ProvisionMountOptions(ctx context.Context, dev, mountOptions string) error
- type CanFSCKer
- type DeviceLister
- type Ext2
- func (t Ext2) CanFSCK() error
- func (t Ext2) FSCK(ctx context.Context, s string) error
- func (t Ext2) Grow(ctx context.Context, dev, mountPoint string) error
- func (t Ext2) IsFormated(ctx context.Context, s string) (bool, error)
- func (t Ext2) MKFS(ctx context.Context, s string, args []string) error
- func (t Ext2) SizeOnDevice(ctx context.Context, dev string) (int64, error)
- type Ext3
- func (t Ext3) CanFSCK() error
- func (t Ext3) FSCK(ctx context.Context, s string) error
- func (t Ext3) Grow(ctx context.Context, dev, mountPoint string) error
- func (t Ext3) IsFormated(ctx context.Context, s string) (bool, error)
- func (t Ext3) MKFS(ctx context.Context, s string, args []string) error
- func (t Ext3) SizeOnDevice(ctx context.Context, dev string) (int64, error)
- type Ext4
- func (t Ext4) CanFSCK() error
- func (t Ext4) FSCK(ctx context.Context, s string) error
- func (t Ext4) Grow(ctx context.Context, dev, mountPoint string) error
- func (t Ext4) IsFormated(ctx context.Context, s string) (bool, error)
- func (t Ext4) MKFS(ctx context.Context, s string, args []string) error
- func (t Ext4) SizeOnDevice(ctx context.Context, dev string) (int64, error)
- type FSCKer
- type Grower
- type I
- type IsCapabler
- type IsFormateder
- type MKFSer
- type MountOptionsProvisioner
- type SelfSizer
- type SizeOnDevicer
- type T
- func (t T) IsFileBacked() bool
- func (t T) IsMultiDevice() bool
- func (t T) IsNetworked() bool
- func (t T) IsReadOnly() bool
- func (t T) IsVirtual() bool
- func (t T) IsZero() bool
- func (t T) KillUsers(ctx context.Context, mnt string) error
- func (t T) Log() *plog.Logger
- func (t T) Mount(ctx context.Context, dev string, mnt string, options string) error
- func (t T) MountNoCanonicalize(ctx context.Context, dev string, mnt string, options string) error
- func (t *T) SetLog(log *plog.Logger)
- func (t T) String() string
- func (t T) Type() string
- func (t T) Umount(ctx context.Context, mnt string) error
- func (t T) UmountNoFollow(ctx context.Context, mnt string) error
- type TMPFS
- type XFS
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotImplemented = errors.New("not implemented")
)
Functions ¶
func DevicesFormated ¶
Types ¶
type BTRFS ¶
type BTRFS struct{ T }
func (BTRFS) Grow ¶
Grow takes the device dev of the filesystem mounted at mountPoint up to the size of the device: a btrfs grows a device at a time, and only while it is mounted.
func (BTRFS) IsFormated ¶
IsFormated reports whether the device holds a btrfs, which "btrfs filesystem show" lists the devices of.
type DeviceLister ¶
DeviceLister is implemented by a filesystem that can span several devices, to tell the devices of the one on dev.
type Grower ¶
Grower is implemented by a filesystem that can be made larger in place, to fill the device it sits on. The device is enlarged first, so the filesystem is only ever asked to take up what is already there.
type I ¶
type I interface {
String() string
Type() string
IsZero() bool
IsNetworked() bool
IsReadOnly() bool
IsVirtual() bool
IsFileBacked() bool
IsMultiDevice() bool
Mount(context.Context, string, string, string) error
MountNoCanonicalize(context.Context, string, string, string) error
Umount(context.Context, string) error
UmountNoFollow(context.Context, string) error
KillUsers(context.Context, string) error
Log() *plog.Logger
SetLog(*plog.Logger)
}
type IsCapabler ¶
type IsCapabler interface {
IsCapable() bool
}
type IsFormateder ¶
type MountOptionsProvisioner ¶
type MountOptionsProvisioner interface {
ProvisionMountOptions(ctx context.Context, dev, mountOptions string) error
}
MountOptionsProvisioner is implemented by a filesystem whose mount options name a part of it to create when it is provisioned, as the subvolume of a btrfs.
type SelfSizer ¶
SelfSizer is implemented by a filesystem that holds its own size rather than taking the size of a device under it. A tmpfs is told how large to be, and has nothing below it to enlarge first, so it is resized in one step and in either direction.
type SizeOnDevicer ¶
SizeOnDevicer is implemented by a filesystem that says the size it takes up of its device, which a grow may leave short of the device.
type T ¶
type T struct {
// contains filtered or unexported fields
}
func (T) IsFileBacked ¶
func (T) IsMultiDevice ¶
func (T) IsNetworked ¶
func (T) IsReadOnly ¶
func (T) MountNoCanonicalize ¶
MountNoCanonicalize mounts dev on mnt as Mount does, mnt passed to the kernel as it is: mount(8) does not resolve it first. It is for a mnt naming a directory the caller opened, as /proc/<pid>/fd/<fd>, which the kernel follows to the directory opened, whatever its path leads to by then.
func (T) UmountNoFollow ¶
UmountNoFollow unmounts the mount at mnt, its last component not followed if it is a link: mnt names it through a directory the caller opened, as /proc/<pid>/fd/<fd>/<name>, and a link swapped in at name is refused rather than followed to another mount. It is the umount2 system call, umount(8) resolving the path first.
type TMPFS ¶
type TMPFS struct{ T }
func (TMPFS) SetSize ¶
SetSize changes how large the filesystem may grow.
A tmpfs holds its own size: there is no device under it to enlarge first, and no filesystem structure to rewrite, so one remount does it in either direction. Made smaller than what it already holds it keeps the pages and reports itself full, which the kernel allows and a caller asked for.