void do_io(struct io_thread_req *req) 
void do_io(struct io_thread_req *req, struct request *r, unsigned long *bitmap) 
void do_io(struct io_thread_req *req){	char *buf;	unsigned long len;	int n, nsectors, start, end, bit;	int err;	__u64 off;	nsectors = req->length / req->sectorsize;	start = 0;	do {		bit = ubd_test_bit(start, (unsigned char *) &req->sector_mask);		end = start;		while((end < nsectors) &&		      (ubd_test_bit(end, (unsigned char *)				    &req->sector_mask) == bit))			end++;		off = req->offset + req->offsets[bit] +			start * req->sectorsize;		len = (end - start) * req->sectorsize;		buf = &req->buffer[start * req->sectorsize];		err = os_seek_file(req->fds[bit], off);		if(err < 0){			printk("do_io - lseek failed : err = %d\n", -err);			req->error = 1;			return;		}		if(req->op == UBD_READ){			n = 0;			do {				buf = &buf[n];				len -= n;				n = os_read_file(req->fds[bit], buf, len);				if (n < 0) {					printk("do_io - read failed, err = %d "					       "fd = %d\n", -n, req->fds[bit]);					req->error = 1;					return;				}			} while((n < len) && (n != 0));			if (n < len) memset(&buf[n], 0, len - n);		} else {			n = os_write_file(req->fds[bit], buf, len);			if(n != len){				printk("do_io - write failed err = %d "				       "fd = %d\n", -n, req->fds[bit]);				req->error = 1;				return;			}		}		start = end;	} while(start < nsectors);	req->error = update_bitmap(req);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/09ace81c1d737bcbb2423db235ac980cac4d5de9/ubd_kern.c/buggy/arch/um/drivers/ubd_kern.c