git: c2a591813a9b - main - linuxkpi: Add `show_fdinfo()` to `struct file_operations`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Mon, 07 Apr 2025 18:01:25 UTC
The branch main has been updated by dumbbell:

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

commit c2a591813a9b3ebec2f06a87ca812c1c8b94da3a
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2025-02-08 21:42:30 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2025-04-07 17:35:14 +0000

    linuxkpi: Add `show_fdinfo()` to `struct file_operations`
    
    We never call this field but it allows to compile drivers without
    modifications.
    
    This is used by the DRM drivers for some time, but another change part
    of the update to Linux 6.8 led to compile them with `CONFIG_PROC_FS`.
    This connected code that uses this struct field.
    
    Reviewed by:    bz
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D49069
---
 sys/compat/linuxkpi/common/include/linux/fs.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h
index 76a81e676744..f1568ad6282d 100644
--- a/sys/compat/linuxkpi/common/include/linux/fs.h
+++ b/sys/compat/linuxkpi/common/include/linux/fs.h
@@ -150,6 +150,11 @@ struct file_operations {
  * an illegal seek error
  */
 	off_t (*llseek)(struct linux_file *, off_t, int);
+/*
+ * Not supported in FreeBSD. That's ok, we never call it and it allows some
+ * drivers like DRM drivers to compile without changes.
+ */
+	void (*show_fdinfo)(struct seq_file *, struct file *);
 #if 0
 	/* We do not support these methods.  Don't permit them to compile. */
 	loff_t (*llseek)(struct file *, loff_t, int);