r253351 implicit definition of 'critical_exit'.

From: Ian FREISLICH <ianf_at_clue.co.za>
Date: Mon, 15 Jul 2013 16:01:21 +0200
Hi

Recent change:
-----
# svn log ./sys/sys/sf_buf.h |less
------------------------------------------------------------------------
r253351 | ae | 2013-07-15 08:16:57 +0200 (Mon, 15 Jul 2013) | 6 lines

Introduce new structure sfstat for collecting sendfile's statistics
and remove corresponding fields from struct mbstat. Use PCPU counters
and SFSTAT_INC() macro for update these statistics.
-----

Includes sys/counter.h in sys/sf_buf.h.  sys/counter.h uses macros
defined in sys/systm.h resulting in implicit definitions of
critical_exit and others and then errors in conflicting types for
critical_exit later when sys/system.h is includd _after_ sys/sf_buf.h
in sys/i386/i386/uio_machdep.c.

I haven't checked amd64 yet, but this patch fixes the build:

Index: /usr/src/sys/i386/i386/uio_machdep.c
===================================================================
--- /usr/src/sys/i386/i386/uio_machdep.c        (revision 253361)
+++ /usr/src/sys/i386/i386/uio_machdep.c        (working copy)
_at__at_ -44,8 +44,8 _at__at_
 #include <sys/mutex.h>
 #include <sys/proc.h>
 #include <sys/sched.h>
+#include <sys/systm.h>
 #include <sys/sf_buf.h>
-#include <sys/systm.h>
 #include <sys/uio.h>
 
 #include <vm/vm.h>

However, sys/system.h coul equally be included in sys/sf_buf.h
before sys/counter.h.  I don't know which is the correct fix.

Ian

-- 
Ian Freislich
Received on Mon Jul 15 2013 - 12:01:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC