} 
static int scsi_init_io(struct scsi_cmnd *cmd){	struct request     *req = cmd->request;	struct scatterlist *sgpnt;	int		   count;	/*	 * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer	 */	if ((req->flags & REQ_BLOCK_PC) && !req->bio) {		cmd->request_bufflen = req->data_len;		cmd->request_buffer = req->data;		req->buffer = req->data;		cmd->use_sg = 0;		return 0;	}	/*	 * we used to not use scatter-gather for single segment request,	 * but now we do (it makes highmem I/O easier to support without	 * kmapping pages)	 */	cmd->use_sg = req->nr_phys_segments;	/*	 * if sg table allocation fails, requeue request later.	 */	sgpnt = scsi_alloc_sgtable(cmd, GFP_ATOMIC);	if (unlikely(!sgpnt))		return BLKPREP_DEFER;	cmd->request_buffer = (char *) sgpnt;	cmd->request_bufflen = req->nr_sectors << 9;	if (blk_pc_request(req))		cmd->request_bufflen = req->data_len;	req->buffer = NULL;	/* 	 * Next, walk the list, and fill in the addresses and sizes of	 * each segment.	 */	count = blk_rq_map_sg(req->q, req, cmd->request_buffer);	/*	 * mapped well, send it off	 */	if (likely(count <= cmd->use_sg)) {		cmd->use_sg = count;		return 0;	}	printk(KERN_ERR "Incorrect number of segments after building list\n");	printk(KERN_ERR "counted %d, received %d\n", count, cmd->use_sg);	printk(KERN_ERR "req nr_sec %lu, cur_nr_sec %u\n", req->nr_sectors,			req->current_nr_sectors);	/* release the command and kill it */	scsi_release_buffers(cmd);	scsi_put_command(cmd);	return BLKPREP_KILL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7c72ce81870ded9365f4bc5caa98ef1591dd18dd/scsi_lib.c/clean/drivers/scsi/scsi_lib.c