From nobody Wed Sep 30 09:51:23 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hvr0W6fbCz6v8G6 for ; Wed, 30 Sep 2026 09:51:23 +0000 (UTC) (envelope-from git@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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvr0W5wCsz3MlB for ; Wed, 30 Sep 2026 09:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790761883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnULO6V8xzOV80l0wqeJxlanoDhdkDwo9eDfPqa1Ong=; b=F8LZa1EqGRMTLkAHjf+j1tXl+BGRVwZBGgL/J7F6EEHBQJ4Dw21hHBzrjTOj0zxoqkNuhh /9RavCfKO3Zqok+WRolFezXZAqqQ/3I3sCe9HIPGO3Cmded3ADBTrYRVlaIwVKlJz0vsQ/ O0m0Kmkq08s5OKPqt7G1seo/ftFzGouU6UDufAZqpDdaHpVT/W2JjwjSs1twLQzIl1UbxL IzgB5IVljNrOxRWOGls4Olh0VNqSHphbIP1zGqE/Iq2WwJSdbS/xE6rfWz73gh4gnXYt89 jZe1oyuoNryjpSYb7LkQRG9Idrf4+uiq4TYJLO8SBWz2lcAD4oYIV5/JBLp1mw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790761883; b=q044XMwW/32ovp2Zqov34P4loFCV2m1xIQV/wSe0HbTvMvYRgf/oHWGU/hPWuyvWOg1n0o XmGqP46958JI0BubHF5o5d13bGOV4knec7/+Hw4bvT3mwljKklkcFXP+PVKol2nIie5tJM kpcNLcHXtoXUwCyj21nqy5vHtiWQy7niwFXWAMRFmZM9xWP/ygSguXRlOF5TZxJpn4CEP+ rsumZrWjHYSDFe0hLBWe+4SX7ULt6LrUw5Y6VbNUFZfoKWpoO1cIcpP8xs1w9Cnub4gqjZ W0MaeZI2gtoRN3sW6EdFYxK+KDcmsENhD2ywyHHsSDdmsczjfXP4FUqcpxz+dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790761883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PnULO6V8xzOV80l0wqeJxlanoDhdkDwo9eDfPqa1Ong=; b=YJtTDJuwREnodZeU678yJrsxH6yYoz93Uht+d+PsQ+WNORXnodwpZ/3VCddlH9inHBrhb7 ZrQNh3Y5Ck9v9KdgwAkdClkTJKxo9IBJPMuRrCEp/DN1/yY3BiDEKwy+Kj61W5vYq1OiEk YDX3b/u7TxySqGO0MnPZeWzMGah/9ozjBlhuCCuOcaFZoN40m0sUR9KNJqhNIRjZJDNV3y 5EKYpdShYcuGtD/U5ct8tFOd6JUZnLRFdXYuwsV2ahLRtxFaMrsNgnLqa5PkHVbgIjS1xd BhogbGef3S0caXqLdLwncICzV1j7fLwE18QNU5ueQu+VB61kiF8vPtZ0zr8BuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hvr0W46lVzgvZ for ; Wed, 30 Sep 2026 09:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3460b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 30 Sep 2026 09:51:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2fd8d2eb7bb9 - main - cuse: Actually use cuse_modevent() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fd8d2eb7bb91148169471291dbcfa499579b1bc Auto-Submitted: auto-generated Date: Wed, 30 Sep 2026 09:51:23 +0000 Message-Id: <6abcdb9b.3460b.3eb5614f@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2fd8d2eb7bb91148169471291dbcfa499579b1bc commit 2fd8d2eb7bb91148169471291dbcfa499579b1bc Author: Christos Margiolis AuthorDate: 2026-09-30 09:49:41 +0000 Commit: Christos Margiolis CommitDate: 2026-09-30 09:49:41 +0000 cuse: Actually use cuse_modevent() We can call cuse_kern_init()/cuse_kern_uninit() here, rather than using SYSINIT/SYSUNINIT. MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59862 --- sys/fs/cuse/cuse.c | 63 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c index c6107b977dac..dd8eb4d67f80 100644 --- a/sys/fs/cuse/cuse.c +++ b/sys/fs/cuse/cuse.c @@ -74,32 +74,6 @@ #error "PAGE_SIZE is too big!" #endif -static int -cuse_modevent(module_t mod, int type, void *data) -{ - switch (type) { - case MOD_LOAD: - case MOD_UNLOAD: - return (0); - default: - return (EOPNOTSUPP); - } -} - -static moduledata_t cuse_mod = { - .name = "cuse", - .evhand = &cuse_modevent, -}; - -DECLARE_MODULE(cuse, cuse_mod, SI_SUB_DEVFS, SI_ORDER_FIRST); -MODULE_VERSION(cuse, 1); - -/* - * Prevent cuse4bsd.ko and cuse.ko from loading at the same time by - * declaring support for the cuse4bsd interface in cuse.ko: - */ -MODULE_VERSION(cuse4bsd, 1); - #ifdef FEATURE FEATURE(cuse, "Userspace character devices"); #endif @@ -295,7 +269,7 @@ cuse_cmd_unlock(struct cuse_client_command *pccmd) } static void -cuse_kern_init(void *arg) +cuse_kern_init(void) { TAILQ_INIT(&cuse_server_head); @@ -308,10 +282,9 @@ cuse_kern_init(void *arg) (CUSE_VERSION >> 16) & 0xFF, (CUSE_VERSION >> 8) & 0xFF, (CUSE_VERSION >> 0) & 0xFF); } -SYSINIT(cuse_kern_init, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_init, NULL); static void -cuse_kern_uninit(void *arg) +cuse_kern_uninit(void) { void *ptr; @@ -334,7 +307,6 @@ cuse_kern_uninit(void *arg) mtx_destroy(&cuse_global_mtx); } -SYSUNINIT(cuse_kern_uninit, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_uninit, NULL); static int cuse_server_get(struct cuse_server **ppcs) @@ -2062,3 +2034,34 @@ cuse_client_kqfilter(struct cdev *dev, struct knote *kn) cuse_client_kqfilter_poll(dev, pcc); return (error); } + +static int +cuse_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + cuse_kern_init(); + break; + case MOD_UNLOAD: + cuse_kern_uninit(); + break; + default: + return (EOPNOTSUPP); + } + + return (0); +} + +static moduledata_t cuse_mod = { + .name = "cuse", + .evhand = &cuse_modevent, +}; + +DECLARE_MODULE(cuse, cuse_mod, SI_SUB_DEVFS, SI_ORDER_FIRST); +MODULE_VERSION(cuse, 1); + +/* + * Prevent cuse4bsd.ko and cuse.ko from loading at the same time by + * declaring support for the cuse4bsd interface in cuse.ko: + */ +MODULE_VERSION(cuse4bsd, 1);