Documentation
¶
Index ¶
- Variables
- func DriverMajor() int
- func IsCapable() bool
- func WithLogger(log *plog.Logger) funcopt.O
- type Bind
- type Binds
- func (bl Binds) BDev(major, minor int) *Bind
- func (bl Binds) FromBDevPath(s string) *Bind
- func (bl Binds) FromCDevPath(s string) *Bind
- func (bl Binds) HasBDevMajorMinor(major, minor int) bool
- func (bl Binds) HasBDevPath(s string) bool
- func (bl Binds) HasCDevPath(s string) bool
- func (bl Binds) HasIndex(i int) bool
- func (bl Binds) Index(i int) *Bind
- type T
- func (t T) Bind(bDevPath string) (int, error)
- func (t T) Find(path string) (*Bind, error)
- func (t T) HasBlockDev(path string) (bool, error)
- func (t T) QueryAll() (Binds, error)
- func (t T) Unbind(cDevPath string) error
- func (t T) UnbindBDevPath(bDevPath string) error
- func (t T) UnbindMinor(minor int) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrExist = errors.New("the raw device is already bound")
)
Functions ¶
func DriverMajor ¶
func DriverMajor() int
Types ¶
type Bind ¶
Bind hold a raw bind detail
type Binds ¶
type Binds []Bind
Binds is a list of Bind
func (Binds) BDev ¶
BDev returns pointer to bind entry that match 'major' and 'minor' or returns nil
func (Binds) FromBDevPath ¶
FromBDevPath returns pointer to the bind entry that match block dev path 's' or returns nil
func (Binds) FromCDevPath ¶
FromCDevPath returns pointer to bind entry matching raw dev path 's' or returns nil
func (Binds) HasBDevMajorMinor ¶
HasBDevMajorMinor returns true if a raw device is bound to block device 'major' and 'minor'
func (Binds) HasBDevPath ¶
HasBDevPath returns true if a raw device is bound to block device 's'
type T ¶
type T struct {
// contains filtered or unexported fields
}
T holds the actions for raw device
func (T) Bind ¶
Bind create a new raw device for block dev 'bDevPath'
it returns device minor of created raw device
func (T) Find ¶
Find returns bind entry handled by raw if current raw devices handle block device 'path'
func (T) HasBlockDev ¶
HasBlockDev returns true if current raw devices handle block device 'path'
func (T) UnbindBDevPath ¶
UnbindBDevPath unbind raw device associated with block device path 'bDevPath'
It return nil if succeed or if no raw device for block 'bDevPath'
func (T) UnbindMinor ¶
UnbindMinor unbind raw device with 'minor'