Date: Thu, 24 May 2018 01:04:56 +0000 (UTC) From: Matt Macy <mmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334125 - in head/sys: netinet sys Message-ID: <201805240104.w4O14uCH098568@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmacy Date: Thu May 24 01:04:56 2018 New Revision: 334125 URL: https://svnweb.freebsd.org/changeset/base/334125 Log: convert allocations to INVARIANTS M_ZERO Modified: head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/sys/epoch.h Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu May 24 01:03:31 2018 (r334124) +++ head/sys/netinet/ip_divert.c Thu May 24 01:04:56 2018 (r334125) @@ -672,7 +672,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_EPOCH_CALL_WAITOK); + il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_divcbinfo); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu May 24 01:03:31 2018 (r334124) +++ head/sys/netinet/raw_ip.c Thu May 24 01:04:56 2018 (r334125) @@ -1056,7 +1056,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_EPOCH_CALL_WAITOK); + il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_ripcbinfo); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu May 24 01:03:31 2018 (r334124) +++ head/sys/netinet/tcp_subr.c Thu May 24 01:04:56 2018 (r334125) @@ -2151,7 +2151,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_EPOCH_CALL_WAITOK); + il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); inp_list = il->il_inp_list; INP_INFO_WLOCK(&V_tcbinfo); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu May 24 01:03:31 2018 (r334124) +++ head/sys/netinet/udp_usrreq.c Thu May 24 01:04:56 2018 (r334125) @@ -874,7 +874,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return (error); - il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_EPOCH_CALL_WAITOK); + il = malloc(sizeof(struct in_pcblist) + n * sizeof(struct inpcb *), M_TEMP, M_WAITOK|M_ZERO_INVARIANTS); inp_list = il->il_inp_list; INP_INFO_RLOCK(&V_udbinfo); Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu May 24 01:03:31 2018 (r334124) +++ head/sys/sys/epoch.h Thu May 24 01:04:56 2018 (r334125) @@ -64,14 +64,6 @@ int in_epoch(void); DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); -#ifdef INVARIANTS -#define M_EPOCH_CALL_NOWAIT (M_NOWAIT|M_ZERO) -#define M_EPOCH_CALL_WAITOK (M_WAITOK|M_ZERO) -#else -#define M_EPOCH_CALL_NOWAIT M_NOWAIT -#define M_EPOCH_CALL_WAITOK M_WAITOK -#endif - static __inline void epoch_enter_preempt(epoch_t epoch) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805240104.w4O14uCH098568>
