Skip to content

Commit 80e928f

Browse files
dhowellsAl Viro
authored and
Al Viro
committed
proc: Kill create_proc_entry()
Kill create_proc_entry() in favour of create_proc_read_entry(), proc_create() and proc_create_data(). Signed-off-by: David Howells <[email protected]>
1 parent 3cba537 commit 80e928f

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

fs/proc/generic.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,9 @@ struct proc_dir_entry *proc_mkdir(const char *name,
650650
}
651651
EXPORT_SYMBOL(proc_mkdir);
652652

653-
struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
654-
struct proc_dir_entry *parent)
653+
struct proc_dir_entry *create_proc_read_entry(
654+
const char *name, umode_t mode, struct proc_dir_entry *parent,
655+
read_proc_t *read_proc, void *data)
655656
{
656657
struct proc_dir_entry *ent;
657658

@@ -668,14 +669,16 @@ struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
668669

669670
ent = __proc_create(&parent, name, mode, 1);
670671
if (ent) {
672+
ent->read_proc = read_proc;
673+
ent->data = data;
671674
if (proc_register(parent, ent) < 0) {
672675
kfree(ent);
673676
ent = NULL;
674677
}
675678
}
676679
return ent;
677680
}
678-
EXPORT_SYMBOL(create_proc_entry);
681+
EXPORT_SYMBOL(create_proc_read_entry);
679682

680683
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
681684
struct proc_dir_entry *parent,

include/linux/proc_fs.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ extern void proc_root_init(void);
109109

110110
void proc_flush_task(struct task_struct *task);
111111

112-
extern struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
113-
struct proc_dir_entry *parent);
114112
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
115113
struct proc_dir_entry *parent,
116114
const struct file_operations *proc_fops,
@@ -164,17 +162,9 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
164162
return proc_create_data(name, mode, parent, proc_fops, NULL);
165163
}
166164

167-
static inline struct proc_dir_entry *create_proc_read_entry(const char *name,
165+
extern struct proc_dir_entry *create_proc_read_entry(const char *name,
168166
umode_t mode, struct proc_dir_entry *base,
169-
read_proc_t *read_proc, void * data)
170-
{
171-
struct proc_dir_entry *res=create_proc_entry(name,mode,base);
172-
if (res) {
173-
res->read_proc=read_proc;
174-
res->data=data;
175-
}
176-
return res;
177-
}
167+
read_proc_t *read_proc, void *data);
178168

179169
extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
180170
struct proc_dir_entry *parent);
@@ -190,9 +180,6 @@ static inline void proc_flush_task(struct task_struct *task)
190180
{
191181
}
192182

193-
static inline struct proc_dir_entry *create_proc_entry(const char *name,
194-
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
195-
196183
#define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; })
197184

198185
static inline struct proc_dir_entry *proc_create_data(const char *name,

0 commit comments

Comments
 (0)