svn commit: r194990 - in head/sys: cam/scsi dev/iscsi/initiator dev/sound/midi dev/speaker fs/coda fs/pseudofs net sys vm

Konstantin Belousov kib at FreeBSD.org
Thu Jun 25 18:46:31 UTC 2009


Author: kib
Date: Thu Jun 25 18:46:30 2009
New Revision: 194990
URL: http://svn.freebsd.org/changeset/base/194990

Log:
  Change the type of uio_resid member of struct uio from int to ssize_t.
  Note that this does not actually enable full-range i/o requests for
  64 architectures, and is done now to update KBI only.
  
  Tested by:	pho
  Reviewed by:	jhb, bde (as part of the review of the bigger patch)

Modified:
  head/sys/cam/scsi/scsi_target.c
  head/sys/dev/iscsi/initiator/isc_soc.c
  head/sys/dev/sound/midi/midi.c
  head/sys/dev/sound/midi/sequencer.c
  head/sys/dev/speaker/spkr.c
  head/sys/fs/coda/coda_psdev.c
  head/sys/fs/coda/coda_vnops.c
  head/sys/fs/pseudofs/pseudofs_vnops.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/sys/uio.h
  head/sys/vm/vnode_pager.c

Modified: head/sys/cam/scsi/scsi_target.c
==============================================================================
--- head/sys/cam/scsi/scsi_target.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/cam/scsi/scsi_target.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -552,7 +552,7 @@ targwrite(struct cdev *dev, struct uio *
 	softc = (struct targ_softc *)dev->si_drv1;
 	write_len = error = 0;
 	CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
-		  ("write - uio_resid %d\n", uio->uio_resid));
+		  ("write - uio_resid %zd\n", uio->uio_resid));
 	while (uio->uio_resid >= sizeof(user_ccb) && error == 0) {
 		union ccb *ccb;
 

Modified: head/sys/dev/iscsi/initiator/isc_soc.c
==============================================================================
--- head/sys/dev/iscsi/initiator/isc_soc.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/dev/iscsi/initiator/isc_soc.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -322,12 +322,12 @@ so_getbhs(isc_session_t *sp)
      error = soreceive(sp->soc, NULL, uio, 0, 0, &flags);
 
      if(error)
-	  debug(2, "error=%d so_error=%d uio->uio_resid=%d iov.iov_len=%zd",
+	  debug(2, "error=%d so_error=%d uio->uio_resid=%zd iov.iov_len=%zd",
 		error,
 		sp->soc->so_error, uio->uio_resid, iov->iov_len);
      if(!error && (uio->uio_resid > 0)) {
 	  error = EPIPE; // was EAGAIN
-	  debug(2, "error=%d so_error=%d uio->uio_resid=%d iov.iov_len=%zd so_state=%x",
+	  debug(2, "error=%d so_error=%d uio->uio_resid=%zd iov.iov_len=%zd so_state=%x",
 		error,
 		sp->soc->so_error, uio->uio_resid, iov->iov_len, sp->soc->so_state);
      }
@@ -442,7 +442,7 @@ so_recv(isc_session_t *sp, pduq_t *pq)
 			      }
 			      mp = NULL;
 			      
-			      sdebug(4, "uio_resid=0x%x itt=0x%x bp=%p bo=%x len=%x/%x",
+			      sdebug(4, "uio_resid=0x%zx itt=0x%x bp=%p bo=%x len=%x/%x",
 				     uio->uio_resid,
 				     ntohl(pq->pdu.ipdu.bhs.itt),
 				     csio->data_ptr, ntohl(rcmd->bo), ntohl(cmd->edtlen), pq->pdu.ds_len);

Modified: head/sys/dev/sound/midi/midi.c
==============================================================================
--- head/sys/dev/sound/midi/midi.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/dev/sound/midi/midi.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -852,7 +852,7 @@ midi_write(struct cdev *i_dev, struct ui
 
 		used = MIN(MIDIQ_AVAIL(m->outq), uio->uio_resid);
 		used = MIN(used, MIDI_WSIZE);
-		MIDI_DEBUG(5, printf("midiout: resid %d len %jd avail %jd\n",
+		MIDI_DEBUG(5, printf("midiout: resid %zd len %jd avail %jd\n",
 		    uio->uio_resid, (intmax_t)MIDIQ_LEN(m->outq),
 		    (intmax_t)MIDIQ_AVAIL(m->outq)));
 

Modified: head/sys/dev/sound/midi/sequencer.c
==============================================================================
--- head/sys/dev/sound/midi/sequencer.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/dev/sound/midi/sequencer.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -878,7 +878,7 @@ seq_read(struct cdev *i_dev, struct uio 
 	if (scp == NULL)
 		return ENXIO;
 
-	SEQ_DEBUG(7, printf("seq_read: unit %d, resid %d.\n",
+	SEQ_DEBUG(7, printf("seq_read: unit %d, resid %zd.\n",
 	    scp->unit, uio->uio_resid));
 
 	mtx_lock(&scp->seq_lock);
@@ -936,7 +936,7 @@ seq_read(struct cdev *i_dev, struct uio 
 	retval = 0;
 err1:
 	mtx_unlock(&scp->seq_lock);
-	SEQ_DEBUG(6, printf("seq_read: ret %d, resid %d.\n",
+	SEQ_DEBUG(6, printf("seq_read: ret %d, resid %zd.\n",
 	    retval, uio->uio_resid));
 
 	return retval;
@@ -950,7 +950,7 @@ seq_write(struct cdev *i_dev, struct uio
 	int retval;
 	int used;
 
-	SEQ_DEBUG(7, printf("seq_write: unit %d, resid %d.\n",
+	SEQ_DEBUG(7, printf("seq_write: unit %d, resid %zd.\n",
 	    scp->unit, uio->uio_resid));
 
 	if (scp == NULL)
@@ -995,7 +995,7 @@ seq_write(struct cdev *i_dev, struct uio
 
 		used = MIN(uio->uio_resid, 4);
 
-		SEQ_DEBUG(8, printf("seqout: resid %d len %jd avail %jd\n",
+		SEQ_DEBUG(8, printf("seqout: resid %zd len %jd avail %jd\n",
 		    uio->uio_resid, (intmax_t)MIDIQ_LEN(scp->out_q),
 		    (intmax_t)MIDIQ_AVAIL(scp->out_q)));
 
@@ -1115,7 +1115,7 @@ seq_write(struct cdev *i_dev, struct uio
 
 err0:
 	SEQ_DEBUG(6,
-	    printf("seq_write done: leftover buffer length %d retval %d\n",
+	    printf("seq_write done: leftover buffer length %zd retval %d\n",
 	    uio->uio_resid, retval));
 	mtx_unlock(&scp->seq_lock);
 	return retval;

Modified: head/sys/dev/speaker/spkr.c
==============================================================================
--- head/sys/dev/speaker/spkr.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/dev/speaker/spkr.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -439,7 +439,7 @@ spkrwrite(dev, uio, ioflag)
 	int ioflag;
 {
 #ifdef DEBUG
-	printf("spkrwrite: entering with dev = %s, count = %d\n",
+	printf("spkrwrite: entering with dev = %s, count = %zd\n",
 		devtoname(dev), uio->uio_resid);
 #endif /* DEBUG */
 

Modified: head/sys/fs/coda/coda_psdev.c
==============================================================================
--- head/sys/fs/coda/coda_psdev.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/fs/coda/coda_psdev.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -331,7 +331,7 @@ vc_write(struct cdev *dev, struct uio *u
 	 * Get the rest of the data.
 	 */
 	if (vmp->vm_outSize < uiop->uio_resid) {
-		myprintf(("vcwrite: more data than asked for (%d < %d)\n",
+		myprintf(("vcwrite: more data than asked for (%d < %zd)\n",
 		    vmp->vm_outSize, uiop->uio_resid));
 
 		/*

Modified: head/sys/fs/coda/coda_vnops.c
==============================================================================
--- head/sys/fs/coda/coda_vnops.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/fs/coda/coda_vnops.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -331,7 +331,7 @@ coda_rdwr(struct vnode *vp, struct uio *
 	int error = 0;
 
 	MARK_ENTRY(CODA_RDWR_STATS);
-	CODADEBUG(CODA_RDWR, myprintf(("coda_rdwr(%d, %p, %d, %lld, %d)\n",
+	CODADEBUG(CODA_RDWR, myprintf(("coda_rdwr(%d, %p, %zd, %lld, %d)\n",
 	    rw, (void *)uiop->uio_iov->iov_base, uiop->uio_resid,
 	    (long long)uiop->uio_offset, uiop->uio_segflg)););
 
@@ -1470,7 +1470,7 @@ coda_readdir(struct vop_readdir_args *ap
 	int opened_internally = 0;
 
 	MARK_ENTRY(CODA_READDIR_STATS);
-	CODADEBUG(CODA_READDIR, myprintf(("coda_readdir(%p, %d, %lld, %d)\n",
+	CODADEBUG(CODA_READDIR, myprintf(("coda_readdir(%p, %zd, %lld, %d)\n",
 	    (void *)uiop->uio_iov->iov_base, uiop->uio_resid,
 	    (long long)uiop->uio_offset, uiop->uio_segflg)););
 

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -622,9 +622,9 @@ pfs_read(struct vop_read_args *va)
 	VOP_UNLOCK(vn, 0);
 
 	if (pn->pn_flags & PFS_RAWRD) {
-		PFS_TRACE(("%lu resid", (unsigned long)uio->uio_resid));
+		PFS_TRACE(("%zd resid", uio->uio_resid));
 		error = pn_fill(curthread, proc, pn, NULL, uio);
-		PFS_TRACE(("%lu resid", (unsigned long)uio->uio_resid));
+		PFS_TRACE(("%zd resid", uio->uio_resid));
 		goto ret;
 	}
 

Modified: head/sys/net/if_tap.c
==============================================================================
--- head/sys/net/if_tap.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/net/if_tap.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -934,7 +934,7 @@ tapwrite(struct cdev *dev, struct uio *u
 		return (0);
 
 	if ((uio->uio_resid < 0) || (uio->uio_resid > TAPMRU)) {
-		TAPDEBUG("%s invalid packet len = %d, minor = %#x\n",
+		TAPDEBUG("%s invalid packet len = %zd, minor = %#x\n",
 			ifp->if_xname, uio->uio_resid, dev2unit(dev));
 
 		return (EIO);

Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/net/if_tun.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -888,7 +888,7 @@ tunwrite(struct cdev *dev, struct uio *u
 		return (0);
 
 	if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
-		TUNDEBUG(ifp, "len=%d!\n", uio->uio_resid);
+		TUNDEBUG(ifp, "len=%zd!\n", uio->uio_resid);
 		return (EIO);
 	}
 

Modified: head/sys/sys/uio.h
==============================================================================
--- head/sys/sys/uio.h	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/sys/uio.h	Thu Jun 25 18:46:30 2009	(r194990)
@@ -64,7 +64,7 @@ struct uio {
 	struct	iovec *uio_iov;		/* scatter/gather list */
 	int	uio_iovcnt;		/* length of scatter/gather list */
 	off_t	uio_offset;		/* offset in target object */
-	int	uio_resid;		/* remaining bytes to process */
+	ssize_t	uio_resid;		/* remaining bytes to process */
 	enum	uio_seg uio_segflg;	/* address space */
 	enum	uio_rw uio_rw;		/* operation */
 	struct	thread *uio_td;		/* owner */

Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c	Thu Jun 25 18:44:05 2009	(r194989)
+++ head/sys/vm/vnode_pager.c	Thu Jun 25 18:46:30 2009	(r194990)
@@ -1161,7 +1161,7 @@ vnode_pager_generic_putpages(vp, m, byte
 	}
 	if (auio.uio_resid) {
 		if (ppscheck || ppsratecheck(&lastfail, &curfail, 1))
-			printf("vnode_pager_putpages: residual I/O %d at %lu\n",
+			printf("vnode_pager_putpages: residual I/O %zd at %lu\n",
 			    auio.uio_resid, (u_long)m[0]->pindex);
 	}
 	for (i = 0; i < ncount; i++) {


More information about the svn-src-head mailing list