.. | .. |
---|
21 | 21 | size_t pad_until; |
---|
22 | 22 | loff_t index; |
---|
23 | 23 | loff_t read_pos; |
---|
24 | | - u64 version; |
---|
25 | 24 | struct mutex lock; |
---|
26 | 25 | const struct seq_operations *op; |
---|
27 | 26 | int poll_event; |
---|
.. | .. |
---|
108 | 107 | char *mangle_path(char *s, const char *p, const char *esc); |
---|
109 | 108 | int seq_open(struct file *, const struct seq_operations *); |
---|
110 | 109 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); |
---|
| 110 | +ssize_t seq_read_iter(struct kiocb *iocb, struct iov_iter *iter); |
---|
111 | 111 | loff_t seq_lseek(struct file *, loff_t, int); |
---|
112 | 112 | int seq_release(struct inode *, struct file *); |
---|
113 | 113 | int seq_write(struct seq_file *seq, const void *data, size_t len); |
---|
.. | .. |
---|
127 | 127 | unsigned long long v, unsigned int width); |
---|
128 | 128 | |
---|
129 | 129 | void seq_escape(struct seq_file *m, const char *s, const char *esc); |
---|
| 130 | +void seq_escape_mem_ascii(struct seq_file *m, const char *src, size_t isz); |
---|
130 | 131 | |
---|
131 | 132 | void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type, |
---|
132 | 133 | int rowsize, int groupsize, const void *buf, size_t len, |
---|
.. | .. |
---|
145 | 146 | int seq_open_private(struct file *, const struct seq_operations *, int); |
---|
146 | 147 | int seq_release_private(struct inode *, struct file *); |
---|
147 | 148 | |
---|
| 149 | +#define DEFINE_SEQ_ATTRIBUTE(__name) \ |
---|
| 150 | +static int __name ## _open(struct inode *inode, struct file *file) \ |
---|
| 151 | +{ \ |
---|
| 152 | + int ret = seq_open(file, &__name ## _sops); \ |
---|
| 153 | + if (!ret && inode->i_private) { \ |
---|
| 154 | + struct seq_file *seq_f = file->private_data; \ |
---|
| 155 | + seq_f->private = inode->i_private; \ |
---|
| 156 | + } \ |
---|
| 157 | + return ret; \ |
---|
| 158 | +} \ |
---|
| 159 | + \ |
---|
| 160 | +static const struct file_operations __name ## _fops = { \ |
---|
| 161 | + .owner = THIS_MODULE, \ |
---|
| 162 | + .open = __name ## _open, \ |
---|
| 163 | + .read = seq_read, \ |
---|
| 164 | + .llseek = seq_lseek, \ |
---|
| 165 | + .release = seq_release, \ |
---|
| 166 | +} |
---|
| 167 | + |
---|
148 | 168 | #define DEFINE_SHOW_ATTRIBUTE(__name) \ |
---|
149 | 169 | static int __name ## _open(struct inode *inode, struct file *file) \ |
---|
150 | 170 | { \ |
---|
.. | .. |
---|
159 | 179 | .release = single_release, \ |
---|
160 | 180 | } |
---|
161 | 181 | |
---|
| 182 | +#define DEFINE_PROC_SHOW_ATTRIBUTE(__name) \ |
---|
| 183 | +static int __name ## _open(struct inode *inode, struct file *file) \ |
---|
| 184 | +{ \ |
---|
| 185 | + return single_open(file, __name ## _show, PDE_DATA(inode)); \ |
---|
| 186 | +} \ |
---|
| 187 | + \ |
---|
| 188 | +static const struct proc_ops __name ## _proc_ops = { \ |
---|
| 189 | + .proc_open = __name ## _open, \ |
---|
| 190 | + .proc_read = seq_read, \ |
---|
| 191 | + .proc_lseek = seq_lseek, \ |
---|
| 192 | + .proc_release = single_release, \ |
---|
| 193 | +} |
---|
| 194 | + |
---|
162 | 195 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) |
---|
163 | 196 | { |
---|
164 | 197 | #ifdef CONFIG_USER_NS |
---|