cmd->data = rq->data; 
 /* * get scatterlist from block layer */ n_elem = blk_rq_map_sg(lun->disk->queue, rq, &cmd->sgv[0]); if (n_elem < 0) { printk(KERN_INFO "%s: failed request map (%d)\n", sc->name, n_elem); /* P3 */ return -1; } if (n_elem > UB_MAX_REQ_SG) {	/* Paranoia */ printk(KERN_WARNING "%s: request with %d segments\n", sc->name, n_elem); return -1; } cmd->nsg = n_elem; sc->sg_stat[n_elem]++;  memcpy(&cmd->cdb, rq->cmd, rq->cmd_len); cmd->cdb_len = rq->cmd_len;  
static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,    struct ub_scsi_cmd *cmd, struct request *rq){	struct ub_request *urq;	urq = &lun->urq;	memset(urq, 0, sizeof(struct ub_request));	urq->rq = rq;	sc->sg_stat[0]++;	if (rq->data_len != 0 && rq->data == NULL) {		static int do_print = 1;		if (do_print) {			printk(KERN_WARNING "%s: unmapped packet request"			    " flags 0x%lx length %d\n",			    sc->name, rq->flags, rq->data_len);			do_print = 0;		}		return -1;	}	memcpy(&cmd->cdb, rq->cmd, rq->cmd_len);	cmd->cdb_len = rq->cmd_len;	if (rq->data_len == 0) {		cmd->dir = UB_DIR_NONE;	} else {		if (rq_data_dir(rq) == WRITE)			cmd->dir = UB_DIR_WRITE;		else			cmd->dir = UB_DIR_READ;	}	cmd->data = rq->data;	cmd->len = rq->data_len;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a1cf96efbabac2f8af6f75286ffcefd40b0a466c/ub.c/buggy/drivers/block/ub.c