else { if(do_ubd || (req = elv_next_request(q)) == NULL) return; err = prepare_request(req, &io_req); if(!err){ do_ubd = ubd_handler; n = os_write_file(thread_fd, (char *) &io_req, sizeof(io_req)); if(n != sizeof(io_req)) printk("write to io thread failed, " "errno = %d\n", -n); } }
in_ubd = 0;
static void do_ubd_request(request_queue_t *q){	struct io_thread_req io_req;	struct request *req;	int err, n;	if(thread_fd == -1){		while((req = elv_next_request(q)) != NULL){			err = prepare_request(req, &io_req);			if(!err){				do_io(&io_req);				__ubd_finish(req, io_req.error);			}		}	}	else {		if(do_ubd || (req = elv_next_request(q)) == NULL)			return;		err = prepare_request(req, &io_req);		if(!err){			do_ubd = ubd_handler;			n = os_write_file(thread_fd, (char *) &io_req,					 sizeof(io_req));			if(n != sizeof(io_req))				printk("write to io thread failed, "				       "errno = %d\n", -n);		}	}}