diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-17 11:58:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-17 11:58:04 -0400 |
commit | 57a8ec387e1441ea5e1232bc0749fb99a8cba7e7 (patch) | |
tree | b5fb03fc6bc5754de8b5b1f8b0e4f36d67c8315c /fs/proc/inode.c | |
parent | 0a8ad0ffa4d80a544f6cbff703bf6394339afcdf (diff) | |
parent | 43e11fa2d1d3b6e35629fa556eb7d571edba2010 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton:
"VM:
- z3fold fixes and enhancements by Henry Burns and Vitaly Wool
- more accurate reclaimed slab caches calculations by Yafang Shao
- fix MAP_UNINITIALIZED UAPI symbol to not depend on config, by
Christoph Hellwig
- !CONFIG_MMU fixes by Christoph Hellwig
- new novmcoredd parameter to omit device dumps from vmcore, by
Kairui Song
- new test_meminit module for testing heap and pagealloc
initialization, by Alexander Potapenko
- ioremap improvements for huge mappings, by Anshuman Khandual
- generalize kprobe page fault handling, by Anshuman Khandual
- device-dax hotplug fixes and improvements, by Pavel Tatashin
- enable synchronous DAX fault on powerpc, by Aneesh Kumar K.V
- add pte_devmap() support for arm64, by Robin Murphy
- unify locked_vm accounting with a helper, by Daniel Jordan
- several misc fixes
core/lib:
- new typeof_member() macro including some users, by Alexey Dobriyan
- make BIT() and GENMASK() available in asm, by Masahiro Yamada
- changed LIST_POISON2 on x86_64 to 0xdead000000000122 for better
code generation, by Alexey Dobriyan
- rbtree code size optimizations, by Michel Lespinasse
- convert struct pid count to refcount_t, by Joel Fernandes
get_maintainer.pl:
- add --no-moderated switch to skip moderated ML's, by Joe Perches
misc:
- ptrace PTRACE_GET_SYSCALL_INFO interface
- coda updates
- gdb scripts, various"
[ Using merge message suggestion from Vlastimil Babka, with some editing - Linus ]
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (100 commits)
fs/select.c: use struct_size() in kmalloc()
mm: add account_locked_vm utility function
arm64: mm: implement pte_devmap support
mm: introduce ARCH_HAS_PTE_DEVMAP
mm: clean up is_device_*_page() definitions
mm/mmap: move common defines to mman-common.h
mm: move MAP_SYNC to asm-generic/mman-common.h
device-dax: "Hotremove" persistent memory that is used like normal RAM
mm/hotplug: make remove_memory() interface usable
device-dax: fix memory and resource leak if hotplug fails
include/linux/lz4.h: fix spelling and copy-paste errors in documentation
ipc/mqueue.c: only perform resource calculation if user valid
include/asm-generic/bug.h: fix "cut here" for WARN_ON for __WARN_TAINT architectures
scripts/gdb: add helpers to find and list devices
scripts/gdb: add lx-genpd-summary command
drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl
kernel/pid.c: convert struct pid count to refcount_t
drivers/rapidio/devices/rio_mport_cdev.c: NUL terminate some strings
select: shift restore_saved_sigmask_unless() into poll_select_copy_remaining()
select: change do_poll() to return -ERESTARTNOHAND rather than -EINTR
...
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 5f8d215b3fd0..dbe43a50caf2 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -200,7 +200,8 @@ static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) | |||
200 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 200 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
201 | loff_t rv = -EINVAL; | 201 | loff_t rv = -EINVAL; |
202 | if (use_pde(pde)) { | 202 | if (use_pde(pde)) { |
203 | loff_t (*llseek)(struct file *, loff_t, int); | 203 | typeof_member(struct file_operations, llseek) llseek; |
204 | |||
204 | llseek = pde->proc_fops->llseek; | 205 | llseek = pde->proc_fops->llseek; |
205 | if (!llseek) | 206 | if (!llseek) |
206 | llseek = default_llseek; | 207 | llseek = default_llseek; |
@@ -212,10 +213,11 @@ static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) | |||
212 | 213 | ||
213 | static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | 214 | static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) |
214 | { | 215 | { |
215 | ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); | ||
216 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 216 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
217 | ssize_t rv = -EIO; | 217 | ssize_t rv = -EIO; |
218 | if (use_pde(pde)) { | 218 | if (use_pde(pde)) { |
219 | typeof_member(struct file_operations, read) read; | ||
220 | |||
219 | read = pde->proc_fops->read; | 221 | read = pde->proc_fops->read; |
220 | if (read) | 222 | if (read) |
221 | rv = read(file, buf, count, ppos); | 223 | rv = read(file, buf, count, ppos); |
@@ -226,10 +228,11 @@ static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, | |||
226 | 228 | ||
227 | static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | 229 | static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) |
228 | { | 230 | { |
229 | ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); | ||
230 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 231 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
231 | ssize_t rv = -EIO; | 232 | ssize_t rv = -EIO; |
232 | if (use_pde(pde)) { | 233 | if (use_pde(pde)) { |
234 | typeof_member(struct file_operations, write) write; | ||
235 | |||
233 | write = pde->proc_fops->write; | 236 | write = pde->proc_fops->write; |
234 | if (write) | 237 | if (write) |
235 | rv = write(file, buf, count, ppos); | 238 | rv = write(file, buf, count, ppos); |
@@ -242,8 +245,9 @@ static __poll_t proc_reg_poll(struct file *file, struct poll_table_struct *pts) | |||
242 | { | 245 | { |
243 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 246 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
244 | __poll_t rv = DEFAULT_POLLMASK; | 247 | __poll_t rv = DEFAULT_POLLMASK; |
245 | __poll_t (*poll)(struct file *, struct poll_table_struct *); | ||
246 | if (use_pde(pde)) { | 248 | if (use_pde(pde)) { |
249 | typeof_member(struct file_operations, poll) poll; | ||
250 | |||
247 | poll = pde->proc_fops->poll; | 251 | poll = pde->proc_fops->poll; |
248 | if (poll) | 252 | if (poll) |
249 | rv = poll(file, pts); | 253 | rv = poll(file, pts); |
@@ -256,8 +260,9 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne | |||
256 | { | 260 | { |
257 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 261 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
258 | long rv = -ENOTTY; | 262 | long rv = -ENOTTY; |
259 | long (*ioctl)(struct file *, unsigned int, unsigned long); | ||
260 | if (use_pde(pde)) { | 263 | if (use_pde(pde)) { |
264 | typeof_member(struct file_operations, unlocked_ioctl) ioctl; | ||
265 | |||
261 | ioctl = pde->proc_fops->unlocked_ioctl; | 266 | ioctl = pde->proc_fops->unlocked_ioctl; |
262 | if (ioctl) | 267 | if (ioctl) |
263 | rv = ioctl(file, cmd, arg); | 268 | rv = ioctl(file, cmd, arg); |
@@ -271,8 +276,9 @@ static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned | |||
271 | { | 276 | { |
272 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 277 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
273 | long rv = -ENOTTY; | 278 | long rv = -ENOTTY; |
274 | long (*compat_ioctl)(struct file *, unsigned int, unsigned long); | ||
275 | if (use_pde(pde)) { | 279 | if (use_pde(pde)) { |
280 | typeof_member(struct file_operations, compat_ioctl) compat_ioctl; | ||
281 | |||
276 | compat_ioctl = pde->proc_fops->compat_ioctl; | 282 | compat_ioctl = pde->proc_fops->compat_ioctl; |
277 | if (compat_ioctl) | 283 | if (compat_ioctl) |
278 | rv = compat_ioctl(file, cmd, arg); | 284 | rv = compat_ioctl(file, cmd, arg); |
@@ -286,8 +292,9 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) | |||
286 | { | 292 | { |
287 | struct proc_dir_entry *pde = PDE(file_inode(file)); | 293 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
288 | int rv = -EIO; | 294 | int rv = -EIO; |
289 | int (*mmap)(struct file *, struct vm_area_struct *); | ||
290 | if (use_pde(pde)) { | 295 | if (use_pde(pde)) { |
296 | typeof_member(struct file_operations, mmap) mmap; | ||
297 | |||
291 | mmap = pde->proc_fops->mmap; | 298 | mmap = pde->proc_fops->mmap; |
292 | if (mmap) | 299 | if (mmap) |
293 | rv = mmap(file, vma); | 300 | rv = mmap(file, vma); |
@@ -305,7 +312,7 @@ proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, | |||
305 | unsigned long rv = -EIO; | 312 | unsigned long rv = -EIO; |
306 | 313 | ||
307 | if (use_pde(pde)) { | 314 | if (use_pde(pde)) { |
308 | typeof(proc_reg_get_unmapped_area) *get_area; | 315 | typeof_member(struct file_operations, get_unmapped_area) get_area; |
309 | 316 | ||
310 | get_area = pde->proc_fops->get_unmapped_area; | 317 | get_area = pde->proc_fops->get_unmapped_area; |
311 | #ifdef CONFIG_MMU | 318 | #ifdef CONFIG_MMU |
@@ -326,8 +333,8 @@ static int proc_reg_open(struct inode *inode, struct file *file) | |||
326 | { | 333 | { |
327 | struct proc_dir_entry *pde = PDE(inode); | 334 | struct proc_dir_entry *pde = PDE(inode); |
328 | int rv = 0; | 335 | int rv = 0; |
329 | int (*open)(struct inode *, struct file *); | 336 | typeof_member(struct file_operations, open) open; |
330 | int (*release)(struct inode *, struct file *); | 337 | typeof_member(struct file_operations, release) release; |
331 | struct pde_opener *pdeo; | 338 | struct pde_opener *pdeo; |
332 | 339 | ||
333 | /* | 340 | /* |