From owner-svn-src-all@freebsd.org Sat Aug 29 04:30:09 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 7A70A3CC26A; Sat, 29 Aug 2020 04:30:09 +0000 (UTC) (envelope-from imp@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4Bdk5s0HtRz3dln; Sat, 29 Aug 2020 04:30:08 +0000 (UTC) (envelope-from imp@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 20A741FC6F; Sat, 29 Aug 2020 04:30:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07T4U72D007877; Sat, 29 Aug 2020 04:30:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07T4U6ZC007871; Sat, 29 Aug 2020 04:30:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008290430.07T4U6ZC007871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Aug 2020 04:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364945 - in head/sys: arm/ti/am335x geom kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: arm/ti/am335x geom kern sys X-SVN-Commit-Revision: 364945 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.33 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: Sat, 29 Aug 2020 04:30:09 -0000 Author: imp Date: Sat Aug 29 04:30:06 2020 New Revision: 364945 URL: https://svnweb.freebsd.org/changeset/base/364945 Log: Retire devctl_notify_f() devctl_notify_f isn't needed, so retire it. The flags argument is now unused, so rather than keep it around, retire it. Convert all old users of it to devctl_notify(). This path no longer sleeps, so is safe to call from any context. Since it doesn't sleep, it doesn't need to know if it is OK to sleep or not. Reviewed by: markj@ Differential Revision: https://reviews.freebsd.org/D26140 Modified: head/sys/arm/ti/am335x/am335x_pmic.c head/sys/geom/geom_dev.c head/sys/kern/kern_conf.c head/sys/kern/kern_rctl.c head/sys/kern/subr_bus.c head/sys/sys/devctl.h Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 29 04:30:06 2020 (r364945) @@ -113,7 +113,7 @@ am335x_pmic_intr(void *arg) if (int_reg.aci) { snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", status_reg.acpwr); - devctl_notify_f("ACPI", "ACAD", "power", notify_buf, M_NOWAIT); + devctl_notify("ACPI", "ACAD", "power", notify_buf); } } Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/geom/geom_dev.c Sat Aug 29 04:30:06 2020 (r364945) @@ -213,7 +213,7 @@ g_dev_destroy(void *arg, int flags __unused) sc = cp->private; g_trace(G_T_TOPOLOGY, "g_dev_destroy(%p(%s))", cp, gp->name); snprintf(buf, sizeof(buf), "cdev=%s", gp->name); - devctl_notify_f("GEOM", "DEV", "DESTROY", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "DESTROY", buf); if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) g_access(cp, -cp->acr, -cp->acw, -cp->ace); g_detach(cp); @@ -277,13 +277,13 @@ g_dev_set_media(struct g_consumer *cp) sc = cp->private; dev = sc->sc_dev; snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); - devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); + devctl_notify("DEVFS", "CDEV", "MEDIACHANGE", buf); + devctl_notify("GEOM", "DEV", "MEDIACHANGE", buf); dev = sc->sc_alias; if (dev != NULL) { snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); - devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK); + devctl_notify("DEVFS", "CDEV", "MEDIACHANGE", buf); + devctl_notify("GEOM", "DEV", "MEDIACHANGE", buf); } } @@ -308,7 +308,7 @@ g_dev_resize(struct g_consumer *cp) char buf[SPECNAMELEN + 6]; snprintf(buf, sizeof(buf), "cdev=%s", cp->provider->name); - devctl_notify_f("GEOM", "DEV", "SIZECHANGE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "SIZECHANGE", buf); } struct g_provider * @@ -379,7 +379,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, g_dev_attrchanged(cp, "GEOM::physpath"); snprintf(buf, sizeof(buf), "cdev=%s", gp->name); - devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "CREATE", buf); /* * Now add all the aliases for this drive */ @@ -392,7 +392,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, continue; } snprintf(buf, sizeof(buf), "cdev=%s", gap->ga_alias); - devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK); + devctl_notify("GEOM", "DEV", "CREATE", buf); } return (gp); Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/kern_conf.c Sat Aug 29 04:30:06 2020 (r364945) @@ -546,7 +546,7 @@ notify(struct cdev *dev, const char *ev, int flags) return; memcpy(data, prefix, sizeof(prefix) - 1); memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1); - devctl_notify_f("DEVFS", "CDEV", ev, data, mflags); + devctl_notify("DEVFS", "CDEV", ev, data); free(data, M_TEMP); } Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/kern_rctl.c Sat Aug 29 04:30:06 2020 (r364945) @@ -591,8 +591,8 @@ rctl_enforce(struct proc *p, int resource, uint64_t am p->p_pid, p->p_ucred->cr_ruid, p->p_ucred->cr_prison->pr_prison_racct->prr_name); sbuf_finish(&sb); - devctl_notify_f("RCTL", "rule", "matched", - sbuf_data(&sb), M_NOWAIT); + devctl_notify("RCTL", "rule", "matched", + sbuf_data(&sb)); sbuf_delete(&sb); free(buf, M_RCTL); link->rrl_exceeded = 1; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/kern/subr_bus.c Sat Aug 29 04:30:06 2020 (r364945) @@ -651,8 +651,8 @@ devctl_queue(struct dev_event_info *dei) * @brief Send a 'notification' to userland, using standard ways */ void -devctl_notify_f(const char *system, const char *subsystem, const char *type, - const char *data, int flags __unused) +devctl_notify(const char *system, const char *subsystem, const char *type, + const char *data) { struct dev_event_info *dei; struct sbuf sb; @@ -677,13 +677,6 @@ devctl_notify_f(const char *system, const char *subsys devctl_free_dei(dei); /* overflow -> drop it */ else devctl_queue(dei); -} - -void -devctl_notify(const char *system, const char *subsystem, const char *type, - const char *data) -{ - devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } /* Modified: head/sys/sys/devctl.h ============================================================================== --- head/sys/sys/devctl.h Sat Aug 29 04:29:53 2020 (r364944) +++ head/sys/sys/devctl.h Sat Aug 29 04:30:06 2020 (r364945) @@ -36,8 +36,6 @@ * hook to send the message. */ boolean_t devctl_process_running(void); -void devctl_notify_f(const char *__system, const char *__subsystem, - const char *__type, const char *__data, int __flags); void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); struct sbuf;