svn commit: r259475 - head/sys/kern

Adrian Chadd adrian at freebsd.org
Tue Dec 17 00:54:17 UTC 2013


Ok. I'll go find where I copy pastes thus from. The mbuf code perhaps?

Should we do a big quick tidy up?

Adrian
On Dec 16, 2013 1:40 PM, "Gleb Smirnoff" <glebius at freebsd.org> wrote:

>   Adrian,
>
> On Mon, Dec 16, 2013 at 07:31:24PM +0000, Adrian Chadd wrote:
> A> Modified: head/sys/kern/uipc_syscalls.c
> A>
> ==============================================================================
> A> --- head/sys/kern/uipc_syscalls.c    Mon Dec 16 18:53:09 2013
>  (r259474)
> A> +++ head/sys/kern/uipc_syscalls.c    Mon Dec 16 19:31:23 2013
>  (r259475)
> A> @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$");
> A>  #include <compat/freebsd32/freebsd32_util.h>
> A>  #endif
> A>
> A> +#include <vm/uma.h>
> A> +#include <vm/uma_int.h>
> A> +#include <vm/uma_dbg.h>
> A>  #include <net/vnet.h>
> A>
> A>  #include <security/audit/audit.h>
> A> @@ -130,6 +133,7 @@ static int sfreadahead = 1;
> A>  SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW,
> A>      &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE
> blocks");
> A>
> A> +static uma_zone_t   zone_sfsync;
> A>
> A>  static void
> A>  sfstat_init(const void *unused)
> A> @@ -140,6 +144,22 @@ sfstat_init(const void *unused)
> A>  }
> A>  SYSINIT(sfstat, SI_SUB_MBUF, SI_ORDER_FIRST, sfstat_init, NULL);
> A>
> A> +static void
> A> +sf_sync_init(const void *unused)
> A> +{
> A> +
> A> +    zone_sfsync = uma_zcreate("sendfile_sync", sizeof(struct
> sendfile_sync),
> A> +        NULL, NULL,
> A> +#ifdef      INVARIANTS
> A> +        trash_init, trash_fini,
> A> +#else
> A> +        NULL, NULL,
> A> +#endif
> A> +        UMA_ALIGN_CACHE,
> A> +        0);
> A> +}
>
> You do not need the INVARIANTS ifdef, because uma(9) will do the same thing
> for you automatically. Thus, you also do not need to pollute namespace with
> uma_int.h and uma_dbg.h.
>
> --
> Totus tuus, Glebius.
>


More information about the svn-src-all mailing list