Every writable entry implements ->proc_write_buf() now and procfs copies in what is written before it pins the entry. Remove ->proc_write().
Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- fs/proc/generic.c | 2 -- fs/proc/inode.c | 15 +-------------- include/linux/proc_fs.h | 1 - 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 9c073cb867e5..e3ae11805c0f 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -473,8 +473,6 @@ static int pde_set_flags(struct proc_dir_entry *pde) if (proc_ops->proc_mmap) pde->flags |= PROC_ENTRY_proc_mmap; if (proc_ops->proc_write_buf) { - if (WARN_ON_ONCE(proc_ops->proc_write)) - return -EINVAL; pde->flags |= PROC_ENTRY_proc_write_buf; pde->write_size = proc_ops->proc_write_size ?: PAGE_SIZE - 1; if (proc_ops->proc_flags & PROC_ENTRY_SHORT_WRITES) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index ab30a58879d5..a7ebbe334afa 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -508,14 +508,6 @@ static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, return rv; } -static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos) -{ - const auto write = pde->proc_ops->proc_write; - if (write) - return write(file, buf, count, ppos); - return -EIO; -} - /* * procfs copies in what is written before it pins the entry. A writer that * faults on its buffer then doesn't hold up remove_proc_entry(). @@ -550,15 +542,10 @@ static ssize_t pde_write_buf(struct proc_dir_entry *pde, struct file *file, static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct proc_dir_entry *pde = PDE(file_inode(file)); - ssize_t rv; if (pde_has_proc_write_buf(pde)) return pde_write_buf(pde, file, buf, count, ppos); - if (!pde_pin(pde)) - return -EIO; - rv = pde_write(pde, file, buf, count, ppos); - pde_unpin(pde); - return rv; + return -EIO; } /* diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 8520b18ce1f7..8c406f4d09a5 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -77,7 +77,6 @@ struct proc_ops { int (*proc_open)(struct inode *, struct file *); ssize_t (*proc_read)(struct file *, char __user *, size_t, loff_t *); ssize_t (*proc_read_iter)(struct kiocb *, struct iov_iter *); - ssize_t (*proc_write)(struct file *, const char __user *, size_t, loff_t *); /* * mandatory unless nonseekable_open() or equivalent is used, procfs * seeks seq_file entries itself -- 2.53.0
