@@ -1071,12 +1071,14 @@ This describes how the VFS can manipulate an open file. As of kernel
1071
1071
1072
1072
struct file_operations {
1073
1073
struct module *owner;
1074
+ fop_flags_t fop_flags;
1074
1075
loff_t (*llseek) (struct file *, loff_t, int);
1075
1076
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
1076
1077
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
1077
1078
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
1078
1079
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
1079
- int (*iopoll)(struct kiocb *kiocb, bool spin);
1080
+ int (*iopoll)(struct kiocb *kiocb, struct io_comp_batch *,
1081
+ unsigned int flags);
1080
1082
int (*iterate_shared) (struct file *, struct dir_context *);
1081
1083
__poll_t (*poll) (struct file *, struct poll_table_struct *);
1082
1084
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
@@ -1093,18 +1095,24 @@ This describes how the VFS can manipulate an open file. As of kernel
1093
1095
int (*flock) (struct file *, int, struct file_lock *);
1094
1096
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1095
1097
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1096
- int (*setlease)(struct file *, long, struct file_lock **, void **);
1098
+ void (*splice_eof)(struct file *file);
1099
+ int (*setlease)(struct file *, int, struct file_lease **, void **);
1097
1100
long (*fallocate)(struct file *file, int mode, loff_t offset,
1098
1101
loff_t len);
1099
1102
void (*show_fdinfo)(struct seq_file *m, struct file *f);
1100
1103
#ifndef CONFIG_MMU
1101
1104
unsigned (*mmap_capabilities)(struct file *);
1102
1105
#endif
1103
- ssize_t (*copy_file_range)(struct file *, loff_t, struct file *, loff_t, size_t, unsigned int);
1106
+ ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
1107
+ loff_t, size_t, unsigned int);
1104
1108
loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
1105
1109
struct file *file_out, loff_t pos_out,
1106
1110
loff_t len, unsigned int remap_flags);
1107
1111
int (*fadvise)(struct file *, loff_t, loff_t, int);
1112
+ int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags);
1113
+ int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *,
1114
+ unsigned int poll_flags);
1115
+ int (*mmap_prepare)(struct vm_area_desc *);
1108
1116
};
1109
1117
1110
1118
Again, all methods are called without any locks being held, unless
@@ -1144,7 +1152,8 @@ otherwise noted.
1144
1152
used on 64 bit kernels.
1145
1153
1146
1154
``mmap ``
1147
- called by the mmap(2) system call
1155
+ called by the mmap(2) system call. Deprecated in favour of
1156
+ ``mmap_prepare ``.
1148
1157
1149
1158
``open ``
1150
1159
called by the VFS when an inode should be opened. When the VFS
@@ -1221,6 +1230,11 @@ otherwise noted.
1221
1230
``fadvise ``
1222
1231
possibly called by the fadvise64() system call.
1223
1232
1233
+ ``mmap_prepare ``
1234
+ Called by the mmap(2) system call. Allows a VFS to set up a
1235
+ file-backed memory mapping, most notably establishing relevant
1236
+ private state and VMA callbacks.
1237
+
1224
1238
Note that the file operations are implemented by the specific
1225
1239
filesystem in which the inode resides. When opening a device node
1226
1240
(character or block special) most filesystems will call special
0 commit comments