Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2002 15:00:06 -0800 (PST)
From:      Alfred Perlstein <bright@mu.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/36038
Message-ID:  <200203182300.g2IN06i57659@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/36038; it has been noted by GNATS.

From: Alfred Perlstein <bright@mu.org>
To: freebsd-gnats-submit@FreeBSD.org, tim@robbins.dropbear.id.au
Cc:  
Subject: Re: kern/36038
Date: Mon, 18 Mar 2002 14:53:02 -0800

 Can you try this delta?  Afaik UIO_NOCOPY means don't do anything
 other than updating the uio as if the data had been copied.
 
 Index: kern/subr_mchain.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/kern/subr_mchain.c,v
 retrieving revision 1.4
 diff -u -r1.4 subr_mchain.c
 --- kern/subr_mchain.c	21 Feb 2002 16:23:38 -0000	1.4
 +++ kern/subr_mchain.c	18 Mar 2002 22:56:15 -0000
 @@ -497,6 +497,8 @@
  			while (count--)
  				*target++ = *s++;
  			continue;
 +		    case MB_NONE:
 +			break;
  		}
  		target += count;
  	}
 @@ -524,6 +526,20 @@
  	int mtype, error;
  
  	mtype = (uiop->uio_segflg == UIO_SYSSPACE) ? MB_MSYSTEM : MB_MUSER;
 +	switch (uiop->uio_segflg) {
 +	case UIO_USERSPACE:
 +	case UIO_USERISPACE:
 +		mtype = MB_MUSER;
 +		break;
 +	case UIO_SYSSPACE:
 +		mtype = MB_MSYSTEM;
 +		break;
 +	case UIO_NOCOPY:
 +		mtype = MB_NONE;
 +		break;
 +	default:
 +		return EINVAL;
 +	}
  	while (size > 0 && uiop->uio_resid) {
  		if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL)
  			return EFBIG;
 Index: sys/mchain.h
 ===================================================================
 RCS file: /home/ncvs/src/sys/sys/mchain.h,v
 retrieving revision 1.3
 diff -u -r1.3 mchain.h
 --- sys/mchain.h	27 Feb 2002 17:15:50 -0000	1.3
 +++ sys/mchain.h	18 Mar 2002 22:59:06 -0000
 @@ -113,6 +113,7 @@
  #define MB_MINLINE	2		/* use an inline copy loop */
  #define	MB_MZERO	3		/* bzero(), mb_put_mem only */
  #define	MB_MCUSTOM	4		/* use an user defined function */
 +#define	MB_NONE		5		/* don't copy (UIO_NOCOPY) */
  
  struct mbuf;
  struct mbchain;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203182300.g2IN06i57659>