aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-04-13 23:12:18 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2026-04-21 22:18:26 +0000
commita5ae030d9f8f5557502c4e51d2a083a70c513379 (patch)
treee261e5bad9c8e3ae7fb2c2b2854a864852b397db
parent18c71d97b227e0c6c1d11aa1fd168d19523a3b2e (diff)
linuxkpi: Add `fop_flags` to `struct file_operations`
... along with the `FOP_*` flag constants. Note that this `fop_flags` field is not used on FreeBSD. It is added to make the DRM drivers compile out of the box. The DRM generic code and drivers started this in Linux 6.12. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56450
-rw-r--r--sys/compat/linuxkpi/common/include/linux/fs.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h
index 7e28be070850..749a9fd22d3d 100644
--- a/sys/compat/linuxkpi/common/include/linux/fs.h
+++ b/sys/compat/linuxkpi/common/include/linux/fs.h
@@ -133,8 +133,11 @@ do { \
typedef int (*filldir_t)(void *, const char *, int, off_t, u64, unsigned);
+typedef unsigned int fop_flags_t;
+
struct file_operations {
struct module *owner;
+ fop_flags_t fop_flags; /* Unused on FreeBSD. */
ssize_t (*read)(struct linux_file *, char __user *, size_t, off_t *);
ssize_t (*write)(struct linux_file *, const char __user *, size_t, off_t *);
unsigned int (*poll) (struct linux_file *, struct poll_table_struct *);
@@ -182,6 +185,14 @@ struct file_operations {
int (*setlease)(struct file *, long, struct file_lock **);
#endif
};
+
+#define FOP_BUFFER_RASYNC (1 << 0)
+#define FOP_BUFFER_WASYNC (1 << 1)
+#define FOP_MMAP_SYNC (1 << 2)
+#define FOP_DIO_PARALLEL_WRITE (1 << 3)
+#define FOP_HUGE_PAGES (1 << 4)
+#define FOP_UNSIGNED_OFFSET (1 << 5)
+
#define fops_get(fops) (fops)
#define replace_fops(f, fops) ((f)->f_op = (fops))