Date: Tue, 12 Jul 2011 20:26:53 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: "Andrey V. Elsukov" <ae@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223930 - head/sys/geom Message-ID: <20110712200015.N1311@besplex.bde.org> In-Reply-To: <201107111002.p6BA2R7l085489@svn.freebsd.org> References: <201107111002.p6BA2R7l085489@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110712200015.N1311>