From nobody Wed Oct 07 06:24:34 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 4j034f39vSz6vMTC for ; Wed, 07 Oct 2026 06:24:34 +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 4j034f1cMsz3N8J for ; Wed, 07 Oct 2026 06:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791354274; 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=4nIhgcSJrB/P2fxDsA0sqGCiGxey0s1DpAu02xuC0+k=; b=jpdvjl70cun+pFhALpojLiRyPqFqG08B2Jkm7rUcKWBAjitjibS7P5UTHwl3RbUEHySile bpeaK+qTRfkzXaafTtgoXYSMOQhIXOgmqeMn6pnWY+lYHhmyEMUvUCo3ehN7Vm4tc3w2C9 h/bivlU6CHCgSlmd3z4od561vv9dfaIL9ViZdvjcFYBuYWtLsCXxNCU7HuPPNcqNrR7iR+ M5cwUJ4eVopTIPdPVYdScL5NdJYLweCZ3djBHNtDnMNM3C+wjJKb7mmkKZVR+dSCgfkwcM oeLvHi+7IP+lGPIUWJcYUQyAfLAfEiNEK2jh4wvdOsBLR/GZUVDkOJ+jNTozEw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791354274; b=pHT9zBvFMuoitsOS1eJ3xwBOULNXHl+DEmCwDtA7vmFwwFX8Bj5aX+9vuwon6hiEhzfA4a Q6w47Ng9DlifamanzOPl6YzrdWeBHtbgF/Cr1yiPGfMwNEnjSUgVGrWAxK4MyA4HP1XZD2 amAicPTZ7vI511mHuihVr4bwWRucvPYLOjYb8Ugl0iHw7RYEQWKKpegseHw8MSunfoIG3Y RQ8rQlw1dpHGLiXSqow5DlzGBrp3wXpjs2LnxP0MhnANDwYrbvCDy+4vRFqHpGl3GG8hjR w1qNA9Fy1dFeiJoum7/1pGcbTygtSRl1SboPUp0Gfai1IJrGnvvi2vhui6PsVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791354274; 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=4nIhgcSJrB/P2fxDsA0sqGCiGxey0s1DpAu02xuC0+k=; b=Y5Qb5I53wPlX/42LtPQWajH+/Jhauhg5Q7O60cCeyPhYMPsDE9WM5w4GiYvLbz3NDmZhQg 132OVyoj7V1F5gX3qA1A20+GUgC+/5WhXdKVj/tKo/KATLDzXLI4YeN4bAHI2aCrFhcMuN 3EloiOwOO8SLtIcNoJrW+NQNwtOCrH9QZ0A+ERyrvBiVu61Y65aU9FhhjAf6Yrp70lmASW dZ0gMI1alAtZeeXQ0EM4vhupV10WvP5K3Ru8xfjAQpIYPekqzC4z9kYVHAvqEy84UXCfor Osha3PZpKX0ThhUsaLH9jSHgBLWZ94Q05F4qCagh3pyyefkxCbf5oXAYMbSOYQ== 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 4j034f0hcgzhR9 for ; Wed, 07 Oct 2026 06:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4047d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 07 Oct 2026 06:24:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 4772247a4f74 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 4772247a4f7448471ce8509d5aafedb0959e8239 Auto-Submitted: auto-generated Date: Wed, 07 Oct 2026 06:24:34 +0000 Message-Id: <6ac5e5a2.4047d.4f06a26c@gitrepo.freebsd.org> The branch stable/15 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4772247a4f7448471ce8509d5aafedb0959e8239 commit 4772247a4f7448471ce8509d5aafedb0959e8239 Author: Christos Margiolis AuthorDate: 2026-09-30 09:49:41 +0000 Commit: Christos Margiolis CommitDate: 2026-10-07 06:23:31 +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 (cherry picked from commit 2fd8d2eb7bb91148169471291dbcfa499579b1bc) --- 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);