Skip to content

Commit 8731f14

Browse files
Alexey Dobriyantorvalds
authored andcommitted
proc: remove ->get_info infrastructure
Now that last dozen or so users of ->get_info were removed, ditch it too. Everyone sane shouldd have switched to seq_file interface long ago. P.S.: Co-existing 3 interfaces (->get_info/->read_proc/->proc_fops) for proc is long-standing crap, BTW, thus a) put ->read_proc/->write_proc/read_proc_entry() users on death row, b) new such users should be rejected, c) everyone is encouraged to convert his favourite ->read_proc user or I'll do it, lazy bastards. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 352ced8 commit 8731f14

2 files changed

Lines changed: 2 additions & 20 deletions

File tree

fs/proc/generic.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,7 @@ proc_file_read(struct file *file, char __user *buf, size_t nbytes,
6969
count = min_t(size_t, PROC_BLOCK_SIZE, nbytes);
7070

7171
start = NULL;
72-
if (dp->get_info) {
73-
/* Handle old net routines */
74-
n = dp->get_info(page, &start, *ppos, count);
75-
if (n < count)
76-
eof = 1;
77-
} else if (dp->read_proc) {
72+
if (dp->read_proc) {
7873
/*
7974
* How to be a proc read function
8075
* ------------------------------

include/linux/proc_fs.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ enum {
4040
* /proc file has a parent, but "subdir" is NULL for all
4141
* non-directory entries).
4242
*
43-
* "get_info" is called at "read", while "owner" is used to protect module
43+
* "owner" is used to protect module
4444
* from unloading while proc_dir_entry is in use
4545
*/
4646

4747
typedef int (read_proc_t)(char *page, char **start, off_t off,
4848
int count, int *eof, void *data);
4949
typedef int (write_proc_t)(struct file *file, const char __user *buffer,
5050
unsigned long count, void *data);
51-
typedef int (get_info_t)(char *, char **, off_t, int);
5251

5352
struct proc_dir_entry {
5453
unsigned int low_ino;
@@ -69,7 +68,6 @@ struct proc_dir_entry {
6968
* somewhere.
7069
*/
7170
const struct file_operations *proc_fops;
72-
get_info_t *get_info;
7371
struct module *owner;
7472
struct proc_dir_entry *next, *parent, *subdir;
7573
void *data;
@@ -187,14 +185,6 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
187185
return res;
188186
}
189187

190-
static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
191-
mode_t mode, struct proc_dir_entry *base, get_info_t *get_info)
192-
{
193-
struct proc_dir_entry *res=create_proc_entry(name,mode,base);
194-
if (res) res->get_info=get_info;
195-
return res;
196-
}
197-
198188
extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
199189
const char *name, mode_t mode, const struct file_operations *fops);
200190
extern void proc_net_remove(struct net *net, const char *name);
@@ -234,9 +224,6 @@ static inline struct proc_dir_entry *proc_mkdir(const char *name,
234224
static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
235225
mode_t mode, struct proc_dir_entry *base,
236226
read_proc_t *read_proc, void * data) { return NULL; }
237-
static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
238-
mode_t mode, struct proc_dir_entry *base, get_info_t *get_info)
239-
{ return NULL; }
240227

241228
struct tty_driver;
242229
static inline void proc_tty_register_driver(struct tty_driver *driver) {};

0 commit comments

Comments
 (0)