From owner-svn-src-all@freebsd.org Fri Jan 17 06:10:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 427AE222F3E; Fri, 17 Jan 2020 06:10:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47zVzP12jpz45Zg; Fri, 17 Jan 2020 06:10:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EE86435E; Fri, 17 Jan 2020 06:10:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00H6AP1d055979; Fri, 17 Jan 2020 06:10:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00H6AOTV055976; Fri, 17 Jan 2020 06:10:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001170610.00H6AOTV055976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 17 Jan 2020 06:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356826 - in head/sys: kern net sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern net sys X-SVN-Commit-Revision: 356826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jan 2020 06:10:25 -0000 Author: glebius Date: Fri Jan 17 06:10:24 2020 New Revision: 356826 URL: https://svnweb.freebsd.org/changeset/base/356826 Log: Change argument order of epoch_call() to more natural, first function, then its argument. Reviewed by: imp, cem, jhb Modified: head/sys/kern/subr_epoch.c head/sys/net/pfil.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Jan 17 04:13:16 2020 (r356825) +++ head/sys/kern/subr_epoch.c Fri Jan 17 06:10:24 2020 (r356826) @@ -664,7 +664,7 @@ epoch_wait(epoch_t epoch) } void -epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) +epoch_call(epoch_t epoch, epoch_callback_t callback, epoch_context_t ctx) { epoch_record_t er; ck_epoch_entry_t *cb; @@ -819,7 +819,7 @@ epoch_drain_callbacks(epoch_t epoch) CPU_FOREACH(cpu) { er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); sched_bind(td, cpu); - epoch_call(epoch, &er->er_drain_ctx, &epoch_drain_cb); + epoch_call(epoch, &epoch_drain_cb, &er->er_drain_ctx); } /* restore CPU binding, if any */ Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Fri Jan 17 04:13:16 2020 (r356825) +++ head/sys/net/pfil.c Fri Jan 17 06:10:24 2020 (r356826) @@ -313,9 +313,9 @@ pfil_unlink(struct pfil_link_args *pa, pfil_head_t hea PFIL_UNLOCK(); if (in != NULL) - epoch_call(PFIL_EPOCH, &in->link_epoch_ctx, pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, &in->link_epoch_ctx); if (out != NULL) - epoch_call(PFIL_EPOCH, &out->link_epoch_ctx, pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, &out->link_epoch_ctx); if (in == NULL && out == NULL) return (ENOENT); @@ -443,15 +443,15 @@ retry: if (in != NULL) { head->head_nhooksin--; hook->hook_links--; - epoch_call(PFIL_EPOCH, &in->link_epoch_ctx, - pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, + &in->link_epoch_ctx); } out = pfil_link_remove(&head->head_out, hook); if (out != NULL) { head->head_nhooksout--; hook->hook_links--; - epoch_call(PFIL_EPOCH, &out->link_epoch_ctx, - pfil_link_free); + epoch_call(PFIL_EPOCH, pfil_link_free, + &out->link_epoch_ctx); } if (in != NULL || out != NULL) /* What if some stupid admin put same filter twice? */ Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Fri Jan 17 04:13:16 2020 (r356825) +++ head/sys/sys/epoch.h Fri Jan 17 06:10:24 2020 (r356826) @@ -35,6 +35,7 @@ struct epoch_context { } __aligned(sizeof(void *)); typedef struct epoch_context *epoch_context_t; +typedef void epoch_callback_t(epoch_context_t); #ifdef _KERNEL #include @@ -68,7 +69,7 @@ void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_wait_preempt(epoch_t epoch); void epoch_drain_callbacks(epoch_t epoch); -void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); +void epoch_call(epoch_t epoch, epoch_callback_t cb, epoch_context_t ctx); int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); DPCPU_DECLARE(int, epoch_cb_count); @@ -101,7 +102,7 @@ extern epoch_t net_epoch_preempt; #define NET_EPOCH_ENTER(et) epoch_enter_preempt(net_epoch_preempt, &(et)) #define NET_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) #define NET_EPOCH_WAIT() epoch_wait_preempt(net_epoch_preempt) -#define NET_EPOCH_CALL(f, c) epoch_call(net_epoch_preempt, (c), (f)) +#define NET_EPOCH_CALL(f, c) epoch_call(net_epoch_preempt, (f), (c)) #define NET_EPOCH_ASSERT() MPASS(in_epoch(net_epoch_preempt)) #endif /* _KERNEL */