scsi_target.c (164906) | scsi_target.c (167082) |
---|---|
1/*- 2 * Generic SCSI Target Kernel Mode Driver 3 * 4 * Copyright (c) 2002 Nate Lawson. 5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Generic SCSI Target Kernel Mode Driver 3 * 4 * Copyright (c) 2002 Nate Lawson. 5 * Copyright (c) 1998, 1999, 2001, 2002 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_target.c 164906 2006-12-05 07:45:28Z mjacob $"); | 31__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_target.c 167082 2007-02-27 17:15:39Z jhb $"); |
32 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/conf.h> 38#include <sys/malloc.h> 39#include <sys/poll.h> --- 765 unchanged lines hidden (view full) --- 805 abort_queue = &softc->abort_queue; 806 CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targread\n")); 807 808 /* If no data is available, wait or return immediately */ 809 ccb_h = TAILQ_FIRST(user_queue); 810 user_descr = TAILQ_FIRST(abort_queue); 811 while (ccb_h == NULL && user_descr == NULL) { 812 if ((ioflag & IO_NDELAY) == 0) { | 32 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/conf.h> 38#include <sys/malloc.h> 39#include <sys/poll.h> --- 765 unchanged lines hidden (view full) --- 805 abort_queue = &softc->abort_queue; 806 CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targread\n")); 807 808 /* If no data is available, wait or return immediately */ 809 ccb_h = TAILQ_FIRST(user_queue); 810 user_descr = TAILQ_FIRST(abort_queue); 811 while (ccb_h == NULL && user_descr == NULL) { 812 if ((ioflag & IO_NDELAY) == 0) { |
813 error = msleep(user_queue, NULL, 814 PRIBIO | PCATCH, "targrd", 0); | 813 error = tsleep(user_queue, 814 PRIBIO | PCATCH, "targrd", 0); |
815 ccb_h = TAILQ_FIRST(user_queue); 816 user_descr = TAILQ_FIRST(abort_queue); 817 if (error != 0) { 818 if (error == ERESTART) { 819 continue; 820 } else { 821 goto read_fail; 822 } --- 209 unchanged lines hidden (view full) --- 1032 xpt_print(cab.ccb_h.path, 1033 "Unable to abort CCB, status %#x\n", 1034 cab.ccb_h.status); 1035 } 1036 } 1037 1038 /* If we aborted at least one pending CCB ok, wait for it. */ 1039 if (cab.ccb_h.status == CAM_REQ_CMP) { | 815 ccb_h = TAILQ_FIRST(user_queue); 816 user_descr = TAILQ_FIRST(abort_queue); 817 if (error != 0) { 818 if (error == ERESTART) { 819 continue; 820 } else { 821 goto read_fail; 822 } --- 209 unchanged lines hidden (view full) --- 1032 xpt_print(cab.ccb_h.path, 1033 "Unable to abort CCB, status %#x\n", 1034 cab.ccb_h.status); 1035 } 1036 } 1037 1038 /* If we aborted at least one pending CCB ok, wait for it. */ 1039 if (cab.ccb_h.status == CAM_REQ_CMP) { |
1040 msleep(&softc->pending_ccb_queue, NULL, | 1040 tsleep(&softc->pending_ccb_queue, |
1041 PRIBIO | PCATCH, "tgabrt", 0); 1042 } 1043 1044 /* If we aborted anything from the work queue, wakeup user. */ 1045 if (!TAILQ_EMPTY(&softc->user_ccb_queue) 1046 || !TAILQ_EMPTY(&softc->abort_queue)) 1047 notify_user(softc); 1048} --- 91 unchanged lines hidden --- | 1041 PRIBIO | PCATCH, "tgabrt", 0); 1042 } 1043 1044 /* If we aborted anything from the work queue, wakeup user. */ 1045 if (!TAILQ_EMPTY(&softc->user_ccb_queue) 1046 || !TAILQ_EMPTY(&softc->abort_queue)) 1047 notify_user(softc); 1048} --- 91 unchanged lines hidden --- |