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); } 
if(in_ubd) return; in_ubd = 1; while((req = elv_next_request(q)) != NULL){ struct gendisk *disk = req->rq_disk; struct ubd *dev = disk->private_data; int n, i;  blkdev_dequeue_request(req);  sector = req->sector; n = blk_rq_map_sg(q, req, dev->sg);  for(i = 0; i < n; i++){ struct scatterlist *sg = &dev->sg[i];  err = prepare_request(req, &io_req, sector << 9, sg->offset, sg->length, sg->page); if(err) continue;  sector += sg->length >> 9; do_io(&io_req, req, dev->cow.bitmap); 
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);		}	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/09ace81c1d737bcbb2423db235ac980cac4d5de9/ubd_kern.c/buggy/arch/um/drivers/ubd_kern.c