isc_soc.c (185289) | isc_soc.c (194990) |
---|---|
1/*- 2 * Copyright (c) 2005-2008 Daniel Braniss <danny@cs.huji.ac.il> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * 26 */ 27/* 28 | iSCSI 29 | $Id: isc_soc.c,v 1.26 2007/05/19 06:09:01 danny Exp danny $ 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005-2008 Daniel Braniss <danny@cs.huji.ac.il> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * 26 */ 27/* 28 | iSCSI 29 | $Id: isc_soc.c,v 1.26 2007/05/19 06:09:01 danny Exp danny $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/iscsi/initiator/isc_soc.c 185289 2008-11-25 07:17:11Z scottl $"); | 33__FBSDID("$FreeBSD: head/sys/dev/iscsi/initiator/isc_soc.c 194990 2009-06-25 18:46:30Z kib $"); |
34 35#include "opt_iscsi_initiator.h" 36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/conf.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 275 unchanged lines hidden (view full) --- 317 uio->uio_segflg = UIO_SYSSPACE; 318 uio->uio_td = curthread; // why ... 319 uio->uio_resid = sizeof(bhs_t); 320 321 flags = MSG_WAITALL; 322 error = soreceive(sp->soc, NULL, uio, 0, 0, &flags); 323 324 if(error) | 34 35#include "opt_iscsi_initiator.h" 36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/conf.h> 40#include <sys/systm.h> 41#include <sys/malloc.h> --- 275 unchanged lines hidden (view full) --- 317 uio->uio_segflg = UIO_SYSSPACE; 318 uio->uio_td = curthread; // why ... 319 uio->uio_resid = sizeof(bhs_t); 320 321 flags = MSG_WAITALL; 322 error = soreceive(sp->soc, NULL, uio, 0, 0, &flags); 323 324 if(error) |
325 debug(2, "error=%d so_error=%d uio->uio_resid=%d iov.iov_len=%zd", | 325 debug(2, "error=%d so_error=%d uio->uio_resid=%zd iov.iov_len=%zd", |
326 error, 327 sp->soc->so_error, uio->uio_resid, iov->iov_len); 328 if(!error && (uio->uio_resid > 0)) { 329 error = EPIPE; // was EAGAIN | 326 error, 327 sp->soc->so_error, uio->uio_resid, iov->iov_len); 328 if(!error && (uio->uio_resid > 0)) { 329 error = EPIPE; // was EAGAIN |
330 debug(2, "error=%d so_error=%d uio->uio_resid=%d iov.iov_len=%zd so_state=%x", | 330 debug(2, "error=%d so_error=%d uio->uio_resid=%zd iov.iov_len=%zd so_state=%x", |
331 error, 332 sp->soc->so_error, uio->uio_resid, iov->iov_len, sp->soc->so_state); 333 } 334 335 return error; 336} 337 338/* --- 98 unchanged lines hidden (view full) --- 437 uio->uio_iovcnt = 1; 438 if(len > pq->pdu.ds_len) { 439 pq->iov[1].iov_base = &r; 440 pq->iov[1].iov_len = len - pq->pdu.ds_len; 441 uio->uio_iovcnt++; 442 } 443 mp = NULL; 444 | 331 error, 332 sp->soc->so_error, uio->uio_resid, iov->iov_len, sp->soc->so_state); 333 } 334 335 return error; 336} 337 338/* --- 98 unchanged lines hidden (view full) --- 437 uio->uio_iovcnt = 1; 438 if(len > pq->pdu.ds_len) { 439 pq->iov[1].iov_base = &r; 440 pq->iov[1].iov_len = len - pq->pdu.ds_len; 441 uio->uio_iovcnt++; 442 } 443 mp = NULL; 444 |
445 sdebug(4, "uio_resid=0x%x itt=0x%x bp=%p bo=%x len=%x/%x", | 445 sdebug(4, "uio_resid=0x%zx itt=0x%x bp=%p bo=%x len=%x/%x", |
446 uio->uio_resid, 447 ntohl(pq->pdu.ipdu.bhs.itt), 448 csio->data_ptr, ntohl(rcmd->bo), ntohl(cmd->edtlen), pq->pdu.ds_len); 449 } 450 } 451 } 452 } 453 error = soreceive(so, NULL, uio, mp, NULL, &flags); --- 189 unchanged lines hidden --- | 446 uio->uio_resid, 447 ntohl(pq->pdu.ipdu.bhs.itt), 448 csio->data_ptr, ntohl(rcmd->bo), ntohl(cmd->edtlen), pq->pdu.ds_len); 449 } 450 } 451 } 452 } 453 error = soreceive(so, NULL, uio, mp, NULL, &flags); --- 189 unchanged lines hidden --- |