Documentation ¶
Overview ¶
Package buse uses the Linux NBD layer to emulate a block device in user space
Index ¶
Constants ¶
View Source
const ( // Name of the driver Name = "buse" // Type of the driver Type = api.DriverType_DRIVER_TYPE_BLOCK // BuseDBKey for openstorage BuseDBKey = "OpenStorageBuseKey" // BuseMountPath mount path for openstorage BuseMountPath = "/var/lib/openstorage/buse/" )
View Source
const ( // Defined in <linux/fs.h>: BLKROSET = 4701 // Defined in <linux/nbd.h>: NBD_SET_SOCK = 43776 NBD_SET_BLKSIZE = 43777 NBD_SET_SIZE = 43778 NBD_CONNECT = 43779 NBD_CLEAR_SOCK = 43780 NBD_CLEAR_QUE = 43781 NBD_PRINT_DEBUG = 43782 NBD_SET_SIZE_BLOCKS = 43783 NBD_DISCONNECT = 43784 NBD_SET_TIMEOUT = 43785 NBD_SET_FLAGS = 43786 // enum NBD_CMD_READ = 0 NBD_CMD_WRITE = 1 NBD_CMD_DISC = 2 NBD_CMD_FLUSH = 3 NBD_CMD_TRIM = 4 // values for flags field NBD_FLAG_HAS_FLAGS = (1 << 0) // nbd-server supports flags NBD_FLAG_READ_ONLY = (1 << 1) // device is read-only NBD_FLAG_SEND_FLUSH = (1 << 2) // can flush writeback cache NBD_FLAG_SEND_FUA = (1 << 3) // Send FUA (Force Unit Access) NBD_FLAG_ROTATIONAL = (1 << 4) // Use elevator algorithm - rotational media NBD_FLAG_SEND_TRIM = (1 << 5) // Send TRIM (discard) // These are sent over the network in the request/reply magic fields NBD_REQUEST_MAGIC = 0x25609513 NBD_REPLY_MAGIC = 0x67446698 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device interface { ReadAt(b []byte, off int64) (n int, err error) WriteAt(b []byte, off int64) (n int, err error) }
Device interface is a subset of os.File.
Click to show internal directories.
Click to hide internal directories.