ub_put_cmd(sc, cmd); 
ub_put_cmd(lun, cmd); 
static int ub_cmd_build_block(struct ub_dev *sc, struct ub_scsi_cmd *cmd,    struct request *rq){	int ub_dir;#if 0 /* We use rq->buffer for now */	struct scatterlist *sg;	int n_elem;#endif	unsigned int block, nblks;	if (rq_data_dir(rq) == WRITE)		ub_dir = UB_DIR_WRITE;	else		ub_dir = UB_DIR_READ;	/*	 * get scatterlist from block layer	 */#if 0 /* We use rq->buffer for now */	sg = &cmd->sgv[0];	n_elem = blk_rq_map_sg(q, rq, sg);	if (n_elem <= 0) {		ub_put_cmd(sc, cmd);		ub_end_rq(rq, 0);		blk_start_queue(q);		return 0;		/* request with no s/g entries? */	}	if (n_elem != 1) {		/* Paranoia */		printk(KERN_WARNING "%s: request with %d segments\n",		    sc->name, n_elem);		ub_put_cmd(sc, cmd);		ub_end_rq(rq, 0);		blk_start_queue(q);		return 0;	}#endif	/*	 * XXX Unfortunately, this check does not work. It is quite possible	 * to get bogus non-null rq->buffer if you allow sg by mistake.	 */	if (rq->buffer == NULL) {		/*		 * This must not happen if we set the queue right.		 * The block level must create bounce buffers for us.		 */		static int do_print = 1;		if (do_print) {			printk(KERN_WARNING "%s: unmapped block request"			    " flags 0x%lx sectors %lu\n",			    sc->name, rq->flags, rq->nr_sectors);			do_print = 0;		}		return -1;	}	/*	 * build the command	 *	 * The call to blk_queue_hardsect_size() guarantees that request	 * is aligned, but it is given in terms of 512 byte units, always.	 */	block = rq->sector >> sc->capacity.bshift;	nblks = rq->nr_sectors >> sc->capacity.bshift;	cmd->cdb[0] = (ub_dir == UB_DIR_READ)? READ_10: WRITE_10;	/* 10-byte uses 4 bytes of LBA: 2147483648KB, 2097152MB, 2048GB */	cmd->cdb[2] = block >> 24;	cmd->cdb[3] = block >> 16;	cmd->cdb[4] = block >> 8;	cmd->cdb[5] = block;	cmd->cdb[7] = nblks >> 8;	cmd->cdb[8] = nblks;	cmd->cdb_len = 10;	cmd->dir = ub_dir;	cmd->data = rq->buffer;	cmd->len = rq->nr_sectors * 512;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f4800078d9ed4bd20b1b27f56e7b68cfa0d73038/ub.c/clean/drivers/block/ub.c