Lines Matching refs:io
45 void Devmapper::ioctlInit(struct dm_ioctl* io, size_t dataSize, const char* name, unsigned flags) { in ioctlInit() argument
46 memset(io, 0, dataSize); in ioctlInit()
47 io->data_size = dataSize; in ioctlInit()
48 io->data_start = sizeof(struct dm_ioctl); in ioctlInit()
49 io->version[0] = 4; in ioctlInit()
50 io->version[1] = 0; in ioctlInit()
51 io->version[2] = 0; in ioctlInit()
52 io->flags = flags; in ioctlInit()
54 size_t ret = strlcpy(io->name, name, sizeof(io->name)); in ioctlInit()
55 if (ret >= sizeof(io->name)) abort(); in ioctlInit()
77 struct dm_ioctl* io = (struct dm_ioctl*)buffer; in create() local
80 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, 0); in create()
82 if (ioctl(fd, DM_DEV_CREATE, io)) { in create()
90 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, 0); in create()
97 if (ioctl(fd, DM_DEV_SET_GEOMETRY, io)) { in create()
105 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, 0); in create()
106 if (ioctl(fd, DM_DEV_STATUS, io)) { in create()
113 unsigned minor = (io->dev & 0xff) | ((io->dev >> 12) & 0xfff00); in create()
120 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, DM_STATUS_TABLE_FLAG); in create()
121 io->target_count = 1; in create()
137 if (ioctl(fd, DM_TABLE_LOAD, io)) { in create()
145 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, 0); in create()
147 if (ioctl(fd, DM_DEV_SUSPEND, io)) { in create()
177 struct dm_ioctl* io = (struct dm_ioctl*)buffer; in destroy() local
180 ioctlInit(io, DEVMAPPER_BUFFER_SIZE, name, 0); in destroy()
182 if (ioctl(fd, DM_DEV_REMOVE, io)) { in destroy()
220 struct dm_ioctl* io = (struct dm_ioctl*)buffer; in destroyAll() local
221 ioctlInit(io, (1024 * 64), NULL, 0); in destroyAll()
223 if (ioctl(fd, DM_LIST_DEVICES, io)) { in destroyAll()
231 struct dm_name_list* n = (struct dm_name_list*)(((char*)buffer) + io->data_start); in destroyAll()