git: 8f7dfa4fe2b7 - stable/15 - cuse(3): annotate cuse_init() to suppress thread safety analysis

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 29 Dec 2025 02:12:10 UTC
The branch stable/15 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f7dfa4fe2b79b3fdf096fa26dc7e2b743e1f208

commit 8f7dfa4fe2b79b3fdf096fa26dc7e2b743e1f208
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2025-12-25 18:02:27 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2025-12-29 02:06:47 +0000

    cuse(3): annotate cuse_init() to suppress thread safety analysis
    
    This avoids warnings from clang 21, similar to:
    
        /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
          111 |         TAILQ_INIT(&h_cuse);
              |                     ^
        /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
        /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
          112 |         TAILQ_INIT(&h_cuse_entered);
              |                     ^
        /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
    
    MFC after:      3 days
    
    (cherry picked from commit 5629b5cf79934e0b94ddbbd93b7756f74fe4050a)
---
 lib/libcuse/cuse_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libcuse/cuse_lib.c b/lib/libcuse/cuse_lib.c
index 3f040d0eeeda..48c72258106d 100644
--- a/lib/libcuse/cuse_lib.c
+++ b/lib/libcuse/cuse_lib.c
@@ -93,7 +93,7 @@ static struct cuse_vm_allocation a_cuse[CUSE_ALLOC_UNIT_MAX]
 	pthread_mutex_unlock(&m_cuse)
 
 int
-cuse_init(void)
+cuse_init(void) __no_lock_analysis
 {
 	pthread_mutexattr_t attr;