@@ -908,46 +908,52 @@ \subsection{The file\_operations Structure}
908
908
909
909
For example, every character driver needs to define a function that reads from the device.
910
910
The \cpp |file_operations| structure holds the address of the module's function that performs that operation.
911
- Here is what the definition looks like for kernel 5.4 :
911
+ Here is what the definition looks like for kernel 6.14 :
912
912
913
913
\begin {code }
914
914
struct file_operations {
915
915
struct module *owner;
916
+ fop_flags_t fop_flags;
916
917
loff_t (*llseek) (struct file *, loff_t, int);
917
918
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
918
919
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
919
920
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
920
921
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
921
- int (*iopoll)(struct kiocb *kiocb, bool spin);
922
- int (*iterate) (struct file *, struct dir_context * );
922
+ int (*iopoll)(struct kiocb *kiocb, struct io_comp_batch *,
923
+ unsigned int flags );
923
924
int (*iterate_shared) (struct file *, struct dir_context *);
924
925
__poll_t (*poll) (struct file *, struct poll_table_struct *);
925
926
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
926
927
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
927
928
int (*mmap) (struct file *, struct vm_area_struct *);
928
- unsigned long mmap_supported_flags;
929
929
int (*open) (struct inode *, struct file *);
930
930
int (*flush) (struct file *, fl_owner_t id);
931
931
int (*release) (struct inode *, struct file *);
932
932
int (*fsync) (struct file *, loff_t, loff_t, int datasync);
933
933
int (*fasync) (int, struct file *, int);
934
934
int (*lock) (struct file *, int, struct file_lock *);
935
- ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
936
935
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
937
936
int (*check_flags)(int);
938
937
int (*flock) (struct file *, int, struct file_lock *);
939
938
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
940
939
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
941
- int (*setlease)(struct file *, long, struct file_lock **, void **);
940
+ void (*splice_eof)(struct file *file);
941
+ int (*setlease)(struct file *, int, struct file_lease **, void **);
942
942
long (*fallocate)(struct file *file, int mode, loff_t offset,
943
943
loff_t len);
944
944
void (*show_fdinfo)(struct seq_file *m, struct file *f);
945
+ #ifndef CONFIG_MMU
946
+ unsigned (*mmap_capabilities)(struct file *);
947
+ #endif
945
948
ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
946
949
loff_t, size_t, unsigned int);
947
950
loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
948
951
struct file *file_out, loff_t pos_out,
949
952
loff_t len, unsigned int remap_flags);
950
953
int (*fadvise)(struct file *, loff_t, loff_t, int);
954
+ int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags);
955
+ int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *,
956
+ unsigned int poll_flags);
951
957
} __randomize_layout;
952
958
\end {code }
953
959
0 commit comments