Commit 80e928f7 authored by David Howells's avatar David Howells Committed by Al Viro

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: default avatarDavid Howells <dhowells@redhat.com>
parent 3cba5376
...@@ -650,8 +650,9 @@ struct proc_dir_entry *proc_mkdir(const char *name, ...@@ -650,8 +650,9 @@ struct proc_dir_entry *proc_mkdir(const char *name,
} }
EXPORT_SYMBOL(proc_mkdir); EXPORT_SYMBOL(proc_mkdir);
struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode, struct proc_dir_entry *create_proc_read_entry(
struct proc_dir_entry *parent) const char *name, umode_t mode, struct proc_dir_entry *parent,
read_proc_t *read_proc, void *data)
{ {
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
...@@ -668,6 +669,8 @@ struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode, ...@@ -668,6 +669,8 @@ struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
ent = __proc_create(&parent, name, mode, 1); ent = __proc_create(&parent, name, mode, 1);
if (ent) { if (ent) {
ent->read_proc = read_proc;
ent->data = data;
if (proc_register(parent, ent) < 0) { if (proc_register(parent, ent) < 0) {
kfree(ent); kfree(ent);
ent = NULL; ent = NULL;
...@@ -675,7 +678,7 @@ struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode, ...@@ -675,7 +678,7 @@ struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
} }
return ent; return ent;
} }
EXPORT_SYMBOL(create_proc_entry); EXPORT_SYMBOL(create_proc_read_entry);
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
struct proc_dir_entry *parent, struct proc_dir_entry *parent,
......
...@@ -109,8 +109,6 @@ extern void proc_root_init(void); ...@@ -109,8 +109,6 @@ extern void proc_root_init(void);
void proc_flush_task(struct task_struct *task); void proc_flush_task(struct task_struct *task);
extern struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode,
struct proc_dir_entry *parent);
struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
struct proc_dir_entry *parent, struct proc_dir_entry *parent,
const struct file_operations *proc_fops, const struct file_operations *proc_fops,
...@@ -164,17 +162,9 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode, ...@@ -164,17 +162,9 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
return proc_create_data(name, mode, parent, proc_fops, NULL); return proc_create_data(name, mode, parent, proc_fops, NULL);
} }
static inline struct proc_dir_entry *create_proc_read_entry(const char *name, extern struct proc_dir_entry *create_proc_read_entry(const char *name,
umode_t mode, struct proc_dir_entry *base, umode_t mode, struct proc_dir_entry *base,
read_proc_t *read_proc, void * data) read_proc_t *read_proc, void *data);
{
struct proc_dir_entry *res=create_proc_entry(name,mode,base);
if (res) {
res->read_proc=read_proc;
res->data=data;
}
return res;
}
extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
struct proc_dir_entry *parent); struct proc_dir_entry *parent);
...@@ -190,9 +180,6 @@ static inline void proc_flush_task(struct task_struct *task) ...@@ -190,9 +180,6 @@ static inline void proc_flush_task(struct task_struct *task)
{ {
} }
static inline struct proc_dir_entry *create_proc_entry(const char *name,
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
#define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; }) #define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; })
static inline struct proc_dir_entry *proc_create_data(const char *name, static inline struct proc_dir_entry *proc_create_data(const char *name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment