Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2002 20:44:55 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, current@FreeBSD.ORG
Subject:   Re: buildkernel error with ENABLE_VFS_IOOPT/ZERO_COPY_SOCKETS
Message-ID:  <20020707204455.A62060@panzer.kdm.org>
In-Reply-To: <20020708074116.T13321-100000@gamplex.bde.org>; from bde@zeta.org.au on Mon, Jul 08, 2002 at 07:52:22AM %2B1000
References:  <200207071607.g67G78JX076844@Magelan.Leidinger.net> <20020708074116.T13321-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Jul 08, 2002 at 07:52:22 +1000, Bruce Evans wrote:
> On Sun, 7 Jul 2002, Alexander Leidinger wrote:
> 
> > -current from today fails in kern/kern_subr.c:
> >
> > ../../../kern/kern_subr.c:220: warning: function declaration isn't a prototype
> >
> > ---snip---
> > #if defined(ENABLE_VFS_IOOPT) || defined(ZERO_COPY_SOCKETS)
> > /*
> >  * Experimental support for zero-copy I/O
> >  */
> > static int
> > userspaceco(cp, cnt, uio, obj, disposable)
> >         caddr_t cp;
> >         u_int cnt;
> >         struct uio *uio;
> >         struct vm_object *obj;
> >         int disposable;
> > {
> > ---snip---
> 
> This happens when ENABLE_VFS_IOOPT is configured by ZERO_COPY_SOCKETS is
> not configured.
> 
> I don't like the #includes and declarations being in an unusual order
> just to avoid ifdefs.

The attached patch should fix both issues.

Let me know whether this fixes it for you.

Ken
-- 
Kenneth Merry
ken@kdm.org

--82I3+IH0IqGh5yIs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="kern_subr.c.20020707"

==== //depot/FreeBSD-zero/src/sys/kern/kern_subr.c#15 - /usr/home/ken/perforce/FreeBSD-zero/src/sys/kern/kern_subr.c ====
*** /tmp/tmp.40864.0	Sun Jul  7 20:44:13 2002
--- /usr/home/ken/perforce/FreeBSD-zero/src/sys/kern/kern_subr.c	Sun Jul  7 20:43:57 2002
***************
*** 56,87 ****
  #include <vm/vm.h>
  #include <vm/vm_page.h>
  #include <vm/vm_map.h>
  
  SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, 
  	"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
  
! #ifdef ZERO_COPY_SOCKETS
! #include <vm/vm.h>
! #include <vm/vm_param.h>
! #include <sys/lock.h>
! #include <vm/pmap.h>
! #include <vm/vm_map.h>
! #include <vm/vm_page.h>
! #include <vm/vm_object.h>
! #include <vm/vm_pager.h>
! #include <vm/vm_kern.h>
! #include <vm/vm_extern.h>
! #include <vm/swap_pager.h>
! #include <sys/mbuf.h>
! #include <machine/cpu.h>
  
  /* Declared in uipc_socket.c */
  extern int so_zero_copy_receive;
  
  static int vm_pgmoveco(vm_map_t mapa, vm_object_t srcobj, vm_offset_t kaddr,
  		       vm_offset_t uaddr);
- static int userspaceco(caddr_t cp, u_int cnt, struct uio *uio,
- 			    struct vm_object *obj, int disposable);
  
  static int
  vm_pgmoveco(mapa, srcobj,  kaddr, uaddr)
--- 56,82 ----
  #include <vm/vm.h>
  #include <vm/vm_page.h>
  #include <vm/vm_map.h>
+ #ifdef ZERO_COPY_SOCKETS
+ #include <vm/vm_param.h>
+ #endif /* ZERO_COPY_SOCKETS */
+ #if defined(ZERO_COPY_SOCKETS) || defined(ENABLE_VFS_IOOPT)
+ #include <vm/vm_object.h>
+ #endif
  
  SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, NULL, UIO_MAXIOV, 
  	"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
  
! #if defined(ZERO_COPY_SOCKETS) || defined(ENABLE_VFS_IOOPT)
! static int userspaceco(caddr_t cp, u_int cnt, struct uio *uio,
! 			    struct vm_object *obj, int disposable);
! #endif /* ZERO_COPY_SOCKETS || ENABLE_VFS_IOOPT */
  
+ #ifdef ZERO_COPY_SOCKETS
  /* Declared in uipc_socket.c */
  extern int so_zero_copy_receive;
  
  static int vm_pgmoveco(vm_map_t mapa, vm_object_t srcobj, vm_offset_t kaddr,
  		       vm_offset_t uaddr);
  
  static int
  vm_pgmoveco(mapa, srcobj,  kaddr, uaddr)

--82I3+IH0IqGh5yIs--

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




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