aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-06-12 17:55:34 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-06-20 10:35:37 +0000
commit50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 (patch)
tree5a575fb1688319517c896059198fb83cbc0644f4
parent2e10a6bd562768256f38078b84d95da30e1e2aa1 (diff)
linuxkpi: Add 'fd_empty()`
The DRM drivers generic code started to use it in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57582
-rw-r--r--sys/compat/linuxkpi/common/include/linux/file.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/file.h b/sys/compat/linuxkpi/common/include/linux/file.h
index 4d8f8fba7fab..13eecfa6a2b0 100644
--- a/sys/compat/linuxkpi/common/include/linux/file.h
+++ b/sys/compat/linuxkpi/common/include/linux/file.h
@@ -186,6 +186,12 @@ static inline struct fd fdget(unsigned int fd)
#define fd_file(fd) ((fd).linux_file)
+static inline bool
+fd_empty(struct fd fd)
+{
+ return (fd_file(fd) == NULL);
+}
+
#define file linux_file
#define fget(...) linux_fget(__VA_ARGS__)