diff options
author | David Howells <dhowells@redhat.com> | 2018-05-18 13:46:15 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-05-18 13:46:15 +0300 |
commit | 564def71765caf65040f926c0783b9c27cc6c087 (patch) | |
tree | bf7b7051f76e961a082819f5eb126384495d0a89 /fs/proc/internal.h | |
parent | 5d9de25d934b9a6e3c9efdce782b0d23d0f1fa2a (diff) | |
download | linux-564def71765caf65040f926c0783b9c27cc6c087.tar.xz |
proc: Add a way to make network proc files writable
Provide two extra functions, proc_create_net_data_write() and
proc_create_net_single_write() that act like their non-write versions but
also set a write method in the proc_dir_entry struct.
An internal simple write function is provided that will copy its buffer and
hand it to the pde->write() method if available (or give an error if not).
The buffer may be modified by the write method.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r-- | fs/proc/internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index a318ae5b36b4..916ccc39073d 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -48,6 +48,7 @@ struct proc_dir_entry { const struct seq_operations *seq_ops; int (*single_show)(struct seq_file *, void *); }; + proc_write_t write; void *data; unsigned int state_size; unsigned int low_ino; @@ -187,6 +188,7 @@ static inline bool is_empty_pde(const struct proc_dir_entry *pde) { return S_ISDIR(pde->mode) && !pde->proc_iops; } +extern ssize_t proc_simple_write(struct file *, const char __user *, size_t, loff_t *); /* * inode.c |