Lines Matching defs:bf
65 struct binject_file *bf;
72 bf = (struct binject_file *) (uintptr_t) f->engine_data;
73 ret = read(bf->fd, p, left * sizeof(struct b_user_cmd));
101 struct binject_file *bf;
107 bf = (struct binject_file *) (uintptr_t) f->engine_data;
113 bd->fd_flags[i] = fio_set_fd_nonblocking(bf->fd, "binject");
117 bd->pfds[i].fd = bf->fd;
157 bf = (struct binject_file *) (uintptr_t) f->engine_data;
162 if (fcntl(bf->fd, F_SETFL, bd->fd_flags[i]) < 0)
176 struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
179 ret = write(bf->fd, buc, sizeof(*buc));
190 struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
192 if (io_u->xfer_buflen & (bf->bs - 1)) {
253 static void binject_unmap_dev(struct thread_data *td, struct binject_file *bf)
258 if (bf->fd >= 0) {
259 close(bf->fd);
260 bf->fd = -1;
267 bic.minor = bf->minor;
275 static int binject_map_dev(struct thread_data *td, struct binject_file *bf,
295 bf->minor = bic.minor;
297 sprintf(name, "/dev/binject%u", bf->minor);
319 bf->fd = open(name, O_RDWR);
320 if (bf->fd < 0) {
323 binject_unmap_dev(td, bf);
332 struct binject_file *bf = (struct binject_file *) (uintptr_t) f->engine_data;
334 if (bf) {
335 binject_unmap_dev(td, bf);
336 free(bf);
346 struct binject_file *bf;
363 bf = malloc(sizeof(*bf));
364 bf->bs = bs;
365 bf->minor = bf->fd = -1;
366 f->engine_data = (uintptr_t) bf;
368 if (binject_map_dev(td, bf, f->fd)) {