scsi_target.c (109161) | scsi_target.c (109345) |
---|---|
1/* 2 * SCSI Disk Emulator 3 * 4 * Copyright (c) 2002 Nate Lawson. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/* 2 * SCSI Disk Emulator 3 * 4 * Copyright (c) 2002 Nate Lawson. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/share/examples/scsi_target/scsi_target.c 109161 2003-01-13 05:34:42Z njl $ | 28 * $FreeBSD: head/share/examples/scsi_target/scsi_target.c 109345 2003-01-16 00:24:29Z njl $ |
29 */ 30 31#include <sys/types.h> 32#include <errno.h> 33#include <err.h> 34#include <fcntl.h> 35#include <signal.h> 36#include <stddef.h> --- 411 unchanged lines hidden (view full) --- 448 warnx("Unhandled ccb type %#x on workq", 449 ccb_h->func_code); 450 abort(); 451 /* NOTREACHED */ 452 } 453 454 /* Assume work function handled the exception */ 455 if ((ccb_h->status & CAM_DEV_QFRZN) != 0) { | 29 */ 30 31#include <sys/types.h> 32#include <errno.h> 33#include <err.h> 34#include <fcntl.h> 35#include <signal.h> 36#include <stddef.h> --- 411 unchanged lines hidden (view full) --- 448 warnx("Unhandled ccb type %#x on workq", 449 ccb_h->func_code); 450 abort(); 451 /* NOTREACHED */ 452 } 453 454 /* Assume work function handled the exception */ 455 if ((ccb_h->status & CAM_DEV_QFRZN) != 0) { |
456 warnx("Queue frozen receiving CCB, releasing"); | 456 if (debug) { 457 warnx("Queue frozen receiving CCB, " 458 "releasing"); 459 } |
457 rel_simq(); 458 } 459 460 /* No more work needed for this command. */ 461 if (retval == 0) { 462 TAILQ_REMOVE(&work_queue, ccb_h, 463 periph_links.tqe); 464 } --- 349 unchanged lines hidden (view full) --- 814 warn("malloc backing store"); 815 return (NULL); 816 } 817 num_ctios++; 818 819 /* Initialize CTIO, CTIO descr, and AIO */ 820 ctio->ccb_h.func_code = XPT_CONT_TARGET_IO; 821 ctio->ccb_h.retry_count = 2; | 460 rel_simq(); 461 } 462 463 /* No more work needed for this command. */ 464 if (retval == 0) { 465 TAILQ_REMOVE(&work_queue, ccb_h, 466 periph_links.tqe); 467 } --- 349 unchanged lines hidden (view full) --- 817 warn("malloc backing store"); 818 return (NULL); 819 } 820 num_ctios++; 821 822 /* Initialize CTIO, CTIO descr, and AIO */ 823 ctio->ccb_h.func_code = XPT_CONT_TARGET_IO; 824 ctio->ccb_h.retry_count = 2; |
822 ctio->ccb_h.timeout = 5; | 825 ctio->ccb_h.timeout = CAM_TIME_INFINITY; |
823 ctio->data_ptr = c_descr->buf; 824 ctio->ccb_h.targ_descr = c_descr; 825 c_descr->aiocb.aio_buf = c_descr->buf; 826 c_descr->aiocb.aio_fildes = file_fd; 827 se = &c_descr->aiocb.aio_sigevent; 828 se->sigev_notify = SIGEV_KEVENT; 829 se->sigev_notify_kqueue = kq_fd; 830 se->sigev_value.sigval_ptr = ctio; --- 101 unchanged lines hidden --- | 826 ctio->data_ptr = c_descr->buf; 827 ctio->ccb_h.targ_descr = c_descr; 828 c_descr->aiocb.aio_buf = c_descr->buf; 829 c_descr->aiocb.aio_fildes = file_fd; 830 se = &c_descr->aiocb.aio_sigevent; 831 se->sigev_notify = SIGEV_KEVENT; 832 se->sigev_notify_kqueue = kq_fd; 833 se->sigev_value.sigval_ptr = ctio; --- 101 unchanged lines hidden --- |