FreeBSD/sys/cam/ctl/ctl_backend_block.c
/*
 * Entry point from CTL to the backend for I/O.  We queue everything to a
 * work thread, so this just puts the I/O on a queue and wakes up the
 * thread.
 */
Entry point from CTL to the backend for I/O.  We queue everything to a
work thread, so this just puts the I/O on a queue and wakes up the
thread.
Entry point from CTL to the backend for I / O . We queue everything to a work thread so this just puts the I / O on a queue and wakes up the thread .
static int
ctl_be_block_submit(union ctl_io *io)
{
	struct ctl_be_block_lun *be_lun;
	struct ctl_be_lun *cbe_lun;
	DPRINTF("entered\n");
	cbe_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
		CTL_PRIV_BACKEND_LUN].ptr;
	be_lun = (struct ctl_be_block_lun *)cbe_lun->be_lun;
	KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type "
		"%#x) encountered", io->io_hdr.io_type));
	PRIV(io)->len = 0;
	mtx_lock(&be_lun->queue_lock);
	STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links);
	mtx_unlock(&be_lun->queue_lock);
	taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
	return (CTL_RETVAL_COMPLETE);
}
static int ctl_be_block_submit ( union ctl_io * io ) { struct ctl_be_block_lun * be_lun ; struct ctl_be_lun * cbe_lun ; DPRINTF ( " \n " ) ; cbe_lun = ( struct ctl_be_lun * ) io -> io_hdr . ctl_private [ CTL_PRIV_BACKEND_LUN ] . ptr ; be_lun = ( struct ctl_be_block_lun * ) cbe_lun -> be_lun ; KASSERT ( io -> io_hdr . io_type == CTL_IO_SCSI , ( " " " " , io -> io_hdr . io_type ) ) ; PRIV ( io ) -> len = 0 ; mtx_lock ( & be_lun -> queue_lock ) ; STAILQ_INSERT_TAIL ( & be_lun -> input_queue , & io -> io_hdr , links ) ; mtx_unlock ( & be_lun -> queue_lock ) ; taskqueue_enqueue ( be_lun -> io_taskqueue , & be_lun -> io_task ) ; return ( CTL_RETVAL_COMPLETE ) ; }
Entry point from CTL to the backend for I/O.
Entry point from CTL to the backend for I / O .
/*
	 * Make sure we only get SCSI I/O.
	 */