svn commit: r223930 - head/sys/geom
Bruce Evans
brde at optusnet.com.au
Tue Jul 12 10:27:00 UTC 2011
On Mon, 11 Jul 2011, Andrey V. Elsukov wrote:
> Log:
> Remove include of sys/sbuf.h from geom/geom.h.
> sbuf support is not always required for geom/geom.h users, and no need to
> depend from it.
>
> PR: kern/158398
Thanks. It's not easy to recover from pollution.
> Modified: head/sys/geom/geom.h
> ==============================================================================
> --- head/sys/geom/geom.h Mon Jul 11 08:42:09 2011 (r223929)
> +++ head/sys/geom/geom.h Mon Jul 11 10:02:27 2011 (r223930)
> @@ -44,7 +44,6 @@
> #include <sys/queue.h>
> #include <sys/ioccom.h>
> #include <sys/conf.h>
> -#include <sys/sbuf.h>
> #include <sys/module.h>
>
> struct g_class;
>
Any chance of fixing more pollution? -). 2 more polluting nested
includes are visible in just the above (the last 2). 3 more are above
<sys/queue.h>. There are many more disk-related ones in <sys>.
sys/disk.h still includes <sys/conf.h> for reasons that are probably
only historical (I think the reason for this include moved from there
to here). <sys/buf.h> has massive pollution. It even has an ifdef
to avoid depending on <sys/proc.h> but this was tuned into nonsense
by including <sys/proc.h> unconditionally. Many disk drivers started
using mutexes without actually including <sys/mutex.h> soon after a
polluting include of <sys/mutex.h> was added in one of the <sys>
headers. I gave up trying to police pollution with this. This problem
may have been reduced by centralizing things in geom and collateral
churning of APIs. Most disk drivers now include only <geom/geom_disk.h>
for general disk things, and the pollution there has been reduced to:
- <sys/queue.h.>, <sys/_lock.h> and <sys_mutex.h>. Presumably needed for
geom structs, but shouldn't be exported. Not too bad compared with all
of <sys/mutex.h> and its prerequisites. The disk drivers would have to
have been fixed to include <sys/mutex.h> if they want to actually use
their mutexes.
- <sys/disk.h> and its polluting <sys/conf.h>.
Bruce
More information about the svn-src-head
mailing list