OpenVZ Forum


Home » Mailing lists » Devel » [PATCH -net 2/2] Put proc_net_create() on death row
[PATCH -net 2/2] Put proc_net_create() on death row [message #22858] Tue, 06 November 2007 12:23 Go to next message
Alexey Dobriyan is currently offline  Alexey Dobriyan
Messages: 195
Registered: August 2006
Senior Member
proc_net_create() stands on the way of shrinking the number of
interfaces one can use for /proc files, namely, it uses ->get_info
hook which will be converted, deprecated and deleted on its own
schedule.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 Documentation/feature-removal-schedule.txt |    9 +++++++++
 include/linux/proc_fs.h                    |    8 ++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -130,6 +130,15 @@ Who:	Christoph Hellwig <hch@lst.de>
 
 ---------------------------
 
+What:	proc_net_create()
+When:	2.6.25
+Why:	proc_net_create() stands on the way of shrinking the number of
+	interfaces one can use for /proc files, namely, it uses ->get_info
+	hook which will be deleted later.
+Who:	Alexey Dobriyan <adobriyan@gmail.com>
+
+---------------------------
+
 What:	CONFIG_FORCED_INLINING
 When:	June 2006
 Why:	Config option is there to see if gcc is good enough. (in january
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -196,7 +196,7 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name,
 	return res;
 }
 
-extern struct proc_dir_entry *proc_net_create(struct net *net,
+extern __deprecated struct proc_dir_entry *proc_net_create(struct net *net,
 	const char *name, mode_t mode, get_info_t *get_info);
 extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
 	const char *name, mode_t mode, const struct file_operations *fops);
@@ -208,7 +208,11 @@ extern void proc_net_remove(struct net *net, const char *name);
 #define proc_bus NULL
 
 #define proc_net_fops_create(net, name, mode, fops)  ({ (void)(mode), NULL; })
-#define proc_net_create(net, name, mode, info)	({ (void)(mode), NULL; })
+static inline __deprecated struct proc_dir_entry *proc_net_create(
+	struct net *net, const char *name, mode_t mode, get_info_t *get_info)
+{
+	return NULL;
+}
 static inline void proc_net_remove(struct net *net, const char *name) {}
 
 static inline void proc_flush_task(struct task_struct *task)
Re: [PATCH -net 2/2] Put proc_net_create() on death row [message #22863 is a reply to message #22858] Tue, 06 November 2007 13:28 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Alexey Dobriyan <adobriyan@sw.ru>
Date: Tue, 6 Nov 2007 15:23:50 +0300

> proc_net_create() stands on the way of shrinking the number of
> interfaces one can use for /proc files, namely, it uses ->get_info
> hook which will be converted, deprecated and deleted on its own
> schedule.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>

Applied.
Re: [PATCH -net 2/2] Put proc_net_create() on death row [message #22865 is a reply to message #22858] Tue, 06 November 2007 13:32 Go to previous message
Christoph Hellwig is currently offline  Christoph Hellwig
Messages: 59
Registered: April 2006
Member
On Tue, Nov 06, 2007 at 03:23:50PM +0300, Alexey Dobriyan wrote:
> proc_net_create() stands on the way of shrinking the number of
> interfaces one can use for /proc files, namely, it uses ->get_info
> hook which will be converted, deprecated and deleted on its own
> schedule.

It's just a trivial helper, so please just remove it once you've
converted all users.
Previous Topic: [PATCH -net 1/2] Convert /proc/net/ipv6_route to seq_file interface
Next Topic: [PATCH] Compact some ifdefs in the fib code
Goto Forum:
  


Current Time: Sun Jul 21 11:27:49 GMT 2024

Total time taken to generate the page: 0.02336 seconds