git: 0a005bcc57de - main - linux: Add a LINUX_TODO() macro

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Tue, 24 Nov 2026 16:44:22 UTC
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=0a005bcc57de5b35bc8f0a7111f245b3ca0e9232

commit 0a005bcc57de5b35bc8f0a7111f245b3ca0e9232
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-11-24 15:15:49 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-11-24 16:36:26 +0000

    linux: Add a LINUX_TODO() macro
    
    Unimplemented corners of the Linuxulator are easier to find when they
    announce themselves instead of silently returning.  LINUX_TODO() prints
    a rate-limited message naming the function and what the stub is still
    missing, built on the existing LINUX_RATELIMIT_MSG_OPT1().
    
    Reviewed by:    adrian
    Differential Revision:  https://reviews.freebsd.org/D61329
---
 sys/compat/linux/linux_util.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/compat/linux/linux_util.h b/sys/compat/linux/linux_util.h
index 58f7c533d647..5a95d711f7ba 100644
--- a/sys/compat/linux/linux_util.h
+++ b/sys/compat/linux/linux_util.h
@@ -176,4 +176,11 @@ void	translate_vnhook_major_minor(struct vnode *vp, struct stat *sb);
 		}						\
 	} while (0)
 
+/*
+ * Flag a code path left as a stub.  _criteria is a string literal
+ * naming what the stub still needs before it can be removed.
+ */
+#define LINUX_TODO(_criteria)						\
+	LINUX_RATELIMIT_MSG_OPT1("TODO in %s: " _criteria, __func__)
+
 #endif /* ! _LINUX_UTIL_H_ */