Lines Matching defs:io

237 static void verity_ioctl_init(struct dm_ioctl *io, char *name, unsigned flags)
239 memset(io, 0, DM_BUF_SIZE);
240 io->data_size = DM_BUF_SIZE;
241 io->data_start = sizeof(struct dm_ioctl);
242 io->version[0] = 4;
243 io->version[1] = 0;
244 io->version[2] = 0;
245 io->flags = flags | DM_READONLY_FLAG;
247 strlcpy(io->name, name, sizeof(io->name));
251 static int create_verity_device(struct dm_ioctl *io, char *name, int fd)
253 verity_ioctl_init(io, name, 1);
254 if (ioctl(fd, DM_DEV_CREATE, io)) {
261 static int get_verity_device_name(struct dm_ioctl *io, char *name, int fd, char **dev_name)
263 verity_ioctl_init(io, name, 0);
264 if (ioctl(fd, DM_DEV_STATUS, io)) {
268 int dev_num = (io->dev & 0xff) | ((io->dev >> 12) & 0xfff00);
276 static int load_verity_table(struct dm_ioctl *io, char *name, char *blockdev, int fd, char *table)
279 char *buffer = (char*) io;
286 verity_ioctl_init(io, name, DM_STATUS_TABLE_FLAG);
291 io->target_count = 1;
309 if (ioctl(fd, DM_TABLE_LOAD, io)) {
317 static int resume_verity_table(struct dm_ioctl *io, char *name, int fd)
319 verity_ioctl_init(io, name, 0);
320 if (ioctl(fd, DM_DEV_SUSPEND, io)) {
367 struct dm_ioctl *io = (struct dm_ioctl *) buffer;
371 io->flags |= 1;
372 io->target_count = 1;
389 if (create_verity_device(io, mount_point, fd) < 0) {
395 if (get_verity_device_name(io, mount_point, fd, &verity_blk_name) < 0) {
415 if (load_verity_table(io, mount_point, fstab->blk_device, fd, verity_table) < 0) {
420 if (resume_verity_table(io, mount_point, fd) < 0) {