[PATCH] procfs cleanup/fixes - round 2

Alexander Viro (viro@math.psu.edu)
Thu, 29 Jul 1999 08:26:42 -0400 (EDT)


Linus, I've resurrected the old patch (rewrote it, actually) that
cleanus up a bit more in procfs and a lot in net/*.
Description:

a) proc_net_inode_operations was literally same as
proc_file_inode_operations. proc_register defaults to the latter for regular
files. So we can simply replace proc_net_inode_operations with NULL. Done.

b) new functions - proc_net_create(name, mode, get_info) and
proc_net_remove(name) (inlined wrappers around create_proc_entry() and
remove_proc_entry()). Typical

static foo_proc_entry = {
PROC_NET_FOO, 4, "foo", S_IFREG|S_IRUGO, 1, 0, 0, 0,
&proc_net_inode_operations, foo_get_info
};
...
proc_net_register(&foo_proc_entry);
...
proc_net_unregister(PROC_NET_FOO);

turned into

proc_net_create("foo", 0, foo_get_info);
...
proc_net_remove("foo");
IMHO the latter is much more readable and less prone to breakage.

c) drivers/char/h8.c and drivers/net/bmac.c forgot to unregister
their entries (/proc/h8 and /proc/net/bmac, resp.). Leakage closed.
d) rmmod ax25 released /proc/net/ax25_route twice. Fixed.
e) /proc/net/raw6 and /proc/net/udp6 shared the inumber. Fixed.
f) fs/proc/net.c is the dead code - it's not included into the build
since 2.1.21. Removed.

So there... It makes the things much cleaner and removes a lot of
places where we had to know the proc_dir_entry layout. This is the
straightforward part of the procfs cleanup/fixes and the fattest one -
the rest will be trickier, but it is restricted to smaller area. Please,
apply it.
Cheers,
A;

Patch follows:

diff -urN linux-2.3.12/drivers/char/h8.c linux-bird.proc/drivers/char/h8.c
--- linux-2.3.12/drivers/char/h8.c Mon Jun 21 13:06:18 1999
+++ linux-bird.proc/drivers/char/h8.c Thu Jul 29 07:05:11 1999
@@ -3,6 +3,9 @@
*
* The H8 is used to deal with the power and thermal environment
* of a system.
+ *
+ * Fixes:
+ * June 1999, AV added releasing /proc/h8
*/

#include <linux/config.h>
@@ -125,12 +128,6 @@
&h8_fops
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry h8_proc_entry = {
- 0, 3, "h8", S_IFREG | S_IRUGO, 1, 0, 0, 0, 0, h8_get_info
-};
-#endif
-
union intr_buf intrbuf;
int intr_buf_ptr;
union intr_buf xx;
@@ -322,7 +319,7 @@
request_region(h8_base, 8, "h8");

#ifdef CONFIG_PROC_FS
- proc_register(&proc_root, &h8_proc_entry);
+ create_proc_entry("h8", 0, NULL)->get_info = h8_get_info;
#endif

QUEUE_INIT(&h8_actq, link, h8_cmd_q_t *);
@@ -339,6 +336,7 @@

void cleanup_module(void)
{
+ remove_proc_entry("h8", NULL);
misc_deregister(&h8_device);
release_region(h8_base, 8);
free_irq(h8_irq, NULL);
@@ -356,7 +354,7 @@
printk("H8 at 0x%x IRQ %d\n", h8_base, h8_irq);

#ifdef CONFIG_PROC_FS
- proc_register(&proc_root, &h8_proc_entry);
+ create_proc_entry("h8", 0, NULL)->get_info = h8_get_info;
#endif

misc_register(&h8_device);
diff -urN linux-2.3.12/drivers/net/bmac.c linux-bird.proc/drivers/net/bmac.c
--- linux-2.3.12/drivers/net/bmac.c Mon Jun 21 12:36:24 1999
+++ linux-bird.proc/drivers/net/bmac.c Thu Jul 29 06:13:44 1999
@@ -3,6 +3,9 @@
* Apple Powermacs. Assumes it's under a DBDMA controller.
*
* Copyright (C) 1998 Randy Gobbel.
+ *
+ * May 1999, Al Viro: proper release of /proc/net/bmac entry, switched to
+ * dynamic procfs inode.
*/
#include <linux/config.h>
#include <linux/module.h>
@@ -1310,14 +1313,7 @@

if (!bmac_reset_and_enable(dev, 0)) return -ENOMEM;

-#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_BMAC, 4, "bmac",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- bmac_proc_info
- });
-#endif
+ proc_net_create("bmac", 0, bmac_proc_info);

return 0;
}
@@ -1550,6 +1546,7 @@
{
struct bmac_data *bp = (struct bmac_data *) bmac_devs->priv;
unregister_netdev(bmac_devs);
+ proc_net_remove("bmac");

free_irq(bmac_devs->irq, bmac_misc_intr);
free_irq(bp->tx_dma_intr, bmac_txdma_intr);
diff -urN linux-2.3.12/drivers/net/hamradio/bpqether.c linux-bird.proc/drivers/net/hamradio/bpqether.c
--- linux-2.3.12/drivers/net/hamradio/bpqether.c Wed Jul 7 02:59:00 1999
+++ linux-bird.proc/drivers/net/hamradio/bpqether.c Thu Jul 29 06:25:39 1999
@@ -632,14 +632,7 @@

printk(KERN_INFO "AX.25 ethernet driver version 0.01\n");

-#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_AX25_BPQETHER, 8, "bpqether",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- bpq_get_info
- });
-#endif
+ proc_net_create("bpqether", 0, bpq_get_info);

read_lock_bh(&dev_base_lock);
for (dev = dev_base; dev != NULL; dev = dev->next) {
@@ -673,9 +666,7 @@

unregister_netdevice_notifier(&bpq_dev_notifier);

-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_AX25_BPQETHER);
-#endif
+ proc_net_remove("bpqether");

for (bpq = bpq_devices; bpq != NULL; bpq = bpq->next)
unregister_netdev(&bpq->axdev);
diff -urN linux-2.3.12/drivers/net/hamradio/scc.c linux-bird.proc/drivers/net/hamradio/scc.c
--- linux-2.3.12/drivers/net/hamradio/scc.c Wed Jul 7 02:59:02 1999
+++ linux-bird.proc/drivers/net/hamradio/scc.c Thu Jul 29 06:31:37 1999
@@ -2173,21 +2173,8 @@
return len;
}

-#ifdef CONFIG_PROC_FS
-
-struct proc_dir_entry scc_proc_dir_entry =
-{
- PROC_NET_Z8530, 8, "z8530drv", S_IFREG | S_IRUGO, 1, 0, 0, 0,
- &proc_net_inode_operations, scc_net_get_info
-};
-
-#define scc_net_procfs_init() proc_net_register(&scc_proc_dir_entry);
-#define scc_net_procfs_remove() proc_net_unregister(PROC_NET_Z8530);
-#else
-#define scc_net_procfs_init()
-#define scc_net_procfs_remove()
-#endif
-
+#define scc_net_procfs_init() proc_net_create("z8530drv", 0, scc_net_get_info)
+#define scc_net_procfs_remove() proc_net_remove("z8530drv");

/* ******************************************************************** */
/* * Init SCC driver * */
diff -urN linux-2.3.12/drivers/net/strip.c linux-bird.proc/drivers/net/strip.c
--- linux-2.3.12/drivers/net/strip.c Mon Jun 21 13:11:33 1999
+++ linux-bird.proc/drivers/net/strip.c Thu Jul 29 06:21:05 1999
@@ -1269,25 +1269,6 @@
return(calc_start_len(buffer, start, req_offset, req_len, total, buf));
}

-static const char proc_strip_status_name[] = "strip";
-
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_strip_get_status_info =
-{
- PROC_NET_STRIP_STATUS, /* unsigned short low_ino */
- sizeof(proc_strip_status_name)-1, /* unsigned short namelen */
- proc_strip_status_name, /* const char *name */
- S_IFREG | S_IRUGO, /* mode_t mode */
- 1, /* nlink_t nlink */
- 0, 0, 0, /* uid_t uid, gid_t gid, unsigned long size */
- &proc_net_inode_operations, /* struct inode_operations * ops */
- &get_status_info, /* int (*get_info)(...) */
- NULL, /* void (*fill_inode)(struct inode *); */
- NULL, NULL, NULL, /* struct proc_dir_entry *next, *parent, *subdir; */
- NULL /* void *data; */
-};
-#endif /* CONFIG_PROC_FS */
-
/************************************************************************/
/* Sending routines */

@@ -2854,10 +2835,8 @@
* Register the status file with /proc
*/
#ifdef CONFIG_PROC_FS
- if (proc_net_register(&proc_strip_get_status_info) != 0)
- {
+ if (!proc_net_create("strip", 0, get_status_info))
printk(KERN_ERR "strip: status proc_net_register() failed.\n");
- }
#endif

#ifdef MODULE
@@ -2890,7 +2869,7 @@

/* Unregister with the /proc/net file here. */
#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_STRIP_STATUS);
+ proc_net_remove("strip");
#endif

if ((i = tty_register_ldisc(N_STRIP, NULL)))
diff -urN linux-2.3.12/fs/coda/sysctl.c linux-bird.proc/fs/coda/sysctl.c
--- linux-2.3.12/fs/coda/sysctl.c Wed Jul 7 02:59:58 1999
+++ linux-bird.proc/fs/coda/sysctl.c Thu Jul 29 06:37:36 1999
@@ -476,43 +476,7 @@

*/

-struct proc_dir_entry proc_fs_coda = {
- PROC_FS_CODA, 4, "coda",
- S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
- 0, &proc_dir_inode_operations,
- NULL, NULL,
- NULL,
- NULL, NULL
-};
-
-struct proc_dir_entry proc_coda_vfs = {
- PROC_VFS_STATS , 9, "vfs_stats",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- coda_vfs_stats_get_info
- };
-
-struct proc_dir_entry proc_coda_upcall = {
- PROC_UPCALL_STATS , 12, "upcall_stats",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- coda_upcall_stats_get_info
- };
-
-struct proc_dir_entry proc_coda_permission = {
- PROC_PERMISSION_STATS , 16, "permission_stats",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- coda_permission_stats_get_info
- };
-
-
-struct proc_dir_entry proc_coda_cache_inv = {
- PROC_CACHE_INV_STATS , 15, "cache_inv_stats",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- coda_cache_inv_stats_get_info
- };
+struct proc_dir_entry* proc_fs_coda;

static void coda_proc_modcount(struct inode *inode, int fill)
{
@@ -535,12 +499,16 @@
reset_coda_cache_inv_stats();

#ifdef CONFIG_PROC_FS
- proc_register(&proc_root_fs,&proc_fs_coda);
- proc_fs_coda.fill_inode = &coda_proc_modcount;
- proc_register(&proc_fs_coda,&proc_coda_vfs);
- proc_register(&proc_fs_coda,&proc_coda_upcall);
- proc_register(&proc_fs_coda,&proc_coda_permission);
- proc_register(&proc_fs_coda,&proc_coda_cache_inv);
+ proc_fs_coda = create_proc_entry("coda", S_IFDIR, &proc_root_fs);
+ proc_fs_coda->fill_inode = &coda_proc_modcount;
+ create_proc_entry("vfs_stats", 0, proc_fs_coda)->get_info =
+ coda_vfs_stats_get_info;
+ create_proc_entry("upcall_stats", 0, proc_fs_coda)->get_info =
+ coda_upcall_stats_get_info;
+ create_proc_entry("permission_stats", 0, proc_fs_coda)->get_info =
+ coda_permission_stats_get_info;
+ create_proc_entry("cache_inv_stats", 0, proc_fs_coda)->get_info =
+ coda_cache_inv_stats_get_info;
#endif

#ifdef CONFIG_SYSCTL
@@ -560,10 +528,10 @@
#endif

#if CONFIG_PROC_FS
- proc_unregister(&proc_fs_coda, proc_coda_cache_inv.low_ino);
- proc_unregister(&proc_fs_coda, proc_coda_permission.low_ino);
- proc_unregister(&proc_fs_coda, proc_coda_upcall.low_ino);
- proc_unregister(&proc_fs_coda, proc_coda_vfs.low_ino);
- proc_unregister(&proc_root_fs, proc_fs_coda.low_ino);
+ remove_proc_entry("cache_inv_stats", proc_fs_coda);
+ remove_proc_entry("permission_stats", proc_fs_coda);
+ remove_proc_entry("upcall_stats", proc_fs_coda);
+ remove_proc_entry("vfs_stats", proc_fs_coda);
+ remove_proc_entry("coda", &proc_root_fs);
#endif
}
diff -urN linux-2.3.12/fs/nfs/nfs3xdr.c linux-bird.proc/fs/nfs/nfs3xdr.c
--- linux-2.3.12/fs/nfs/nfs3xdr.c Mon Jun 21 12:36:46 1999
+++ linux-bird.proc/fs/nfs/nfs3xdr.c Thu Jul 29 06:40:58 1999
@@ -679,7 +679,7 @@
static struct proc_dir_entry proc_nfsclnt = {
0, 3, "nfs",
S_IFREG | S_IRUGO, 1, 0, 0,
- 6, &proc_net_inode_operations,
+ 6, NULL,
nfs_get_info
};

diff -urN linux-2.3.12/fs/proc/generic.c linux-bird.proc/fs/proc/generic.c
--- linux-2.3.12/fs/proc/generic.c Sat Jun 26 16:43:05 1999
+++ linux-bird.proc/fs/proc/generic.c Thu Jul 29 06:41:59 1999
@@ -70,33 +70,6 @@
NULL /* revalidate */
};

-/*
- * compatibility to replace fs/proc/net.c
- */
-struct inode_operations proc_net_inode_operations = {
- &proc_file_operations, /* default net file-ops */
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* get_block */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* flushpage */
- NULL, /* truncate */
- NULL, /* permission */
- NULL, /* smap */
- NULL /* revalidate */
-};
-
-
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
diff -urN linux-2.3.12/fs/proc/net.c linux-bird.proc/fs/proc/net.c
--- linux-2.3.12/fs/proc/net.c Sat Jun 26 16:43:05 1999
+++ linux-bird.proc/fs/proc/net.c Wed Dec 31 19:00:00 1969
@@ -1,124 +0,0 @@
-/*
- * linux/fs/proc/net.c
- *
- * Copyright (C) 1991, 1992 Linus Torvalds
- *
- * gjh 3/'93 heim@peanuts.informatik.uni-tuebingen.de (Gerald J. Heim)
- * most of this file is stolen from base.c
- * it works, but you shouldn't use it as a guideline
- * for new proc-fs entries. once i'll make it better.
- * fvk 3/'93 waltje@uwalt.nl.mugnet.org (Fred N. van Kempen)
- * cleaned up the whole thing, moved "net" specific code to
- * the NET kernel layer (where it belonged in the first place).
- * Michael K. Johnson (johnsonm@stolaf.edu) 3/93
- * Added support from my previous inet.c. Cleaned things up
- * quite a bit, modularized the code.
- * fvk 4/'93 waltje@uwalt.nl.mugnet.org (Fred N. van Kempen)
- * Renamed "route_get_info()" to "rt_get_info()" for consistency.
- * Alan Cox (gw4pts@gw4pts.ampr.org) 4/94
- * Dusted off the code and added IPX. Fixed the 4K limit.
- * Erik Schoenfelder (schoenfr@ibr.cs.tu-bs.de)
- * /proc/net/snmp.
- * Alan Cox (gw4pts@gw4pts.ampr.org) 1/95
- * Added AppleTalk slots
- *
- * proc net directory handling functions
- */
-#include <linux/errno.h>
-#include <linux/sched.h>
-#include <linux/proc_fs.h>
-#include <linux/stat.h>
-#include <linux/fcntl.h>
-#include <linux/mm.h>
-
-#include <asm/uaccess.h>
-
-#define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */
-
-static long proc_readnet(struct inode * inode, struct file * file,
- char * buf, unsigned long count)
-{
- char * page;
- int bytes=count;
- int copied=0;
- char *start;
- struct proc_dir_entry * dp;
-
- if (count < 0)
- return -EINVAL;
- dp = (struct proc_dir_entry *) inode->u.generic_ip;
- if (!(page = (char*) __get_free_page(GFP_KERNEL)))
- return -ENOMEM;
-
- while (bytes>0)
- {
- int length, thistime=bytes;
- if (bytes > PROC_BLOCK_SIZE)
- thistime=PROC_BLOCK_SIZE;
-
- length = dp->get_info(page, &start,
- file->f_pos,
- thistime,
- (file->f_flags & O_ACCMODE) == O_RDWR);
-
- /*
- * We have been given a non page aligned block of
- * the data we asked for + a bit. We have been given
- * the start pointer and we know the length..
- */
-
- if (length <= 0)
- break;
- /*
- * Copy the bytes
- */
- copy_to_user(buf+copied, start, length);
- file->f_pos += length; /* Move down the file */
- bytes -= length;
- copied += length;
- if (length<thistime)
- break; /* End of file */
- }
- free_page((unsigned long) page);
- return copied;
-}
-
-static struct file_operations proc_net_operations = {
- NULL, /* lseek - default */
- proc_readnet, /* read - bad */
- NULL, /* write - bad */
- NULL, /* readdir */
- NULL, /* poll - default */
- NULL, /* ioctl - default */
- NULL, /* mmap */
- NULL, /* no special open code */
- NULL, /* flush */
- NULL, /* no special release code */
- NULL /* can't fsync */
-};
-
-/*
- * proc directories can do almost nothing..
- */
-struct inode_operations proc_net_inode_operations = {
- &proc_net_operations, /* default net file-ops */
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* get_block */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* flushpage */
- NULL, /* truncate */
- NULL, /* permission */
- NULL, /* smap */
- NULL /* revalidate */
-};
diff -urN linux-2.3.12/fs/proc/procfs_syms.c linux-bird.proc/fs/proc/procfs_syms.c
--- linux-2.3.12/fs/proc/procfs_syms.c Mon Jun 21 12:36:47 1999
+++ linux-bird.proc/fs/proc/procfs_syms.c Thu Jul 29 06:42:05 1999
@@ -24,7 +24,6 @@
EXPORT_SYMBOL(proc_root_fs);
EXPORT_SYMBOL(proc_get_inode);
EXPORT_SYMBOL(proc_dir_inode_operations);
-EXPORT_SYMBOL(proc_net_inode_operations);
EXPORT_SYMBOL(proc_net);
EXPORT_SYMBOL(proc_bus);

diff -urN linux-2.3.12/include/linux/proc_fs.h linux-bird.proc/include/linux/proc_fs.h
--- linux-2.3.12/include/linux/proc_fs.h Tue Jul 6 04:34:57 1999
+++ linux-bird.proc/include/linux/proc_fs.h Thu Jul 29 07:29:14 1999
@@ -81,73 +81,7 @@
};

enum net_directory_inos {
- PROC_NET_UNIX = 128,
- PROC_NET_ARP,
- PROC_NET_ROUTE,
- PROC_NET_DEV,
- PROC_NET_RAW,
- PROC_NET_RAW6,
- PROC_NET_TCP,
- PROC_NET_TCP6,
- PROC_NET_UDP,
- PROC_NET_UDP6,
- PROC_NET_SNMP,
- PROC_NET_RARP,
- PROC_NET_IGMP,
- PROC_NET_IPMR_VIF,
- PROC_NET_IPMR_MFC,
- PROC_NET_IPFWFWD,
- PROC_NET_IPFWIN,
- PROC_NET_IPFWOUT,
- PROC_NET_IPACCT,
- PROC_NET_IPMSQHST,
- PROC_NET_WIRELESS,
- PROC_NET_IPX_INTERFACE,
- PROC_NET_IPX_ROUTE,
- PROC_NET_IPX,
- PROC_NET_ATALK,
- PROC_NET_AT_ROUTE,
- PROC_NET_ATIF,
- PROC_NET_AX25_ROUTE,
- PROC_NET_AX25,
- PROC_NET_AX25_CALLS,
- PROC_NET_BMAC,
- PROC_NET_NR_NODES,
- PROC_NET_NR_NEIGH,
- PROC_NET_NR,
- PROC_NET_SOCKSTAT,
- PROC_NET_SOCKSTAT6,
- PROC_NET_RTCACHE,
- PROC_NET_AX25_BPQETHER,
- PROC_NET_IP_MASQ_APP,
- PROC_NET_RT6,
- PROC_NET_SNMP6,
- PROC_NET_RT6_STATS,
- PROC_NET_NDISC,
- PROC_NET_STRIP_STATUS,
- PROC_NET_STRIP_TRACE,
- PROC_NET_Z8530,
- PROC_NET_RS_NODES,
- PROC_NET_RS_NEIGH,
- PROC_NET_RS_ROUTES,
- PROC_NET_RS,
- PROC_NET_CL2LLC,
- PROC_NET_X25_ROUTES,
- PROC_NET_X25,
- PROC_NET_TR_RIF,
- PROC_NET_DN_DEV,
- PROC_NET_DN_ADJ,
- PROC_NET_DN_ROUTE,
- PROC_NET_DN_CACHE,
- PROC_NET_DN_SKT,
- PROC_NET_DN_FW_CHAINS,
- PROC_NET_DN_FW_CHAIN_NAMES,
- PROC_NET_DN_RAW,
- PROC_NET_NETSTAT,
- PROC_NET_IPFW_CHAINS,
- PROC_NET_IPFW_CHAIN_NAMES,
- PROC_NET_AT_AARP,
- PROC_NET_BRIDGE,
+ PROC_NET_IP_MASQ_APP = 128,
PROC_NET_LAST
};

@@ -417,7 +351,6 @@

extern struct inode_operations proc_dir_inode_operations;
extern struct inode_operations proc_file_inode_operations;
-extern struct inode_operations proc_net_inode_operations;
extern struct inode_operations proc_netdir_inode_operations;
extern struct inode_operations proc_openprom_inode_operations;
extern struct inode_operations proc_mem_inode_operations;
@@ -454,6 +387,19 @@
* proc_devtree.c
*/
extern void proc_device_tree_init(void);
+
+static inline struct proc_dir_entry *proc_net_create(char *name, mode_t mode,
+ int (*get_info)(char *, char **, off_t, int, int))
+{
+ struct proc_dir_entry *res=create_proc_entry(name,mode,proc_net);
+ if (res) res->get_info=get_info;
+ return res;
+}
+
+static inline void proc_net_remove(char *name)
+{
+ remove_proc_entry(name,proc_net);
+}

#else

@@ -475,6 +421,9 @@
extern inline void proc_tty_register_driver(struct tty_driver *driver) {};
extern inline void proc_tty_unregister_driver(struct tty_driver *driver) {};

+extern inline struct proc_dir_entry *proc_net_create(char *name, mode_t mode,
+ int (*get_info)(char *, char **, off_t, int, int)) {return NULL;};
+extern inline void proc_net_remove(char *name) {};

#endif
#endif /* _LINUX_PROC_FS_H */
diff -urN linux-2.3.12/net/802/tr.c linux-bird.proc/net/802/tr.c
--- linux-2.3.12/net/802/tr.c Mon Jun 21 12:37:04 1999
+++ linux-bird.proc/net/802/tr.c Thu Jul 29 06:43:43 1999
@@ -527,15 +527,6 @@
* too much for this.
*/

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry tr_rif_proc = {
- PROC_NET_TR_RIF, 6, "tr_rif",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rif_get_info
-};
-#endif
-
__initfunc(void rif_init(struct net_proto *unused))
{
rif_timer.expires = RIF_TIMEOUT;
@@ -545,6 +536,6 @@
add_timer(&rif_timer);

#ifdef CONFIG_PROC_FS
- proc_net_register(&tr_rif_proc);
+ proc_net_create("tr_rif", 0, rif_get_info);
#endif
}
diff -urN linux-2.3.12/net/appletalk/aarp.c linux-bird.proc/net/appletalk/aarp.c
--- linux-2.3.12/net/appletalk/aarp.c Mon Jun 21 12:37:04 1999
+++ linux-bird.proc/net/appletalk/aarp.c Thu Jul 29 06:58:47 1999
@@ -1159,22 +1159,14 @@

#ifdef CONFIG_PROC_FS

-static struct proc_dir_entry proc_aarp_entries=
-{
- PROC_NET_AT_AARP, 4, "aarp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- aarp_get_info
-};
-
void aarp_register_proc_fs(void)
{
- proc_net_register(&proc_aarp_entries);
+ proc_net_create("aarp", 0, aarp_get_info);
}

void aarp_unregister_proc_fs(void)
{
- proc_net_unregister(PROC_NET_AT_AARP);
+ proc_net_remove("aarp");
}

#endif
diff -urN linux-2.3.12/net/appletalk/ddp.c linux-bird.proc/net/appletalk/ddp.c
--- linux-2.3.12/net/appletalk/ddp.c Tue Jul 6 04:35:16 1999
+++ linux-bird.proc/net/appletalk/ddp.c Thu Jul 29 06:58:54 1999
@@ -2105,32 +2105,6 @@
EXPORT_SYMBOL(atrtr_get_dev);
EXPORT_SYMBOL(atalk_find_dev_addr);

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_appletalk=
-{
- PROC_NET_ATALK, 9, "appletalk",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- atalk_get_info
-};
-
-static struct proc_dir_entry proc_atalk_route=
-{
- PROC_NET_AT_ROUTE, 11,"atalk_route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- atalk_rt_get_info
-};
-
-static struct proc_dir_entry proc_atalk_iface=
-{
- PROC_NET_ATIF, 11,"atalk_iface",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- atalk_if_get_info
-};
-#endif /* CONFIG_PROC_FS */
-
/* Called by proto.c on kernel start up */

__initfunc(void atalk_proto_init(struct net_proto *pro))
@@ -2149,9 +2123,9 @@
aarp_proto_init();

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_appletalk);
- proc_net_register(&proc_atalk_route);
- proc_net_register(&proc_atalk_iface);
+ proc_net_create("appletalk", 0, atalk_get_info);
+ proc_net_create("atalk_route", 0, atalk_rt_get_info);
+ proc_net_create("atalk_iface", 0, atalk_if_get_info);

aarp_register_proc_fs();
#endif /* CONFIG_PROC_FS */
@@ -2191,9 +2165,9 @@
#endif /* CONFIG_SYSCTL */

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_ATALK);
- proc_net_unregister(PROC_NET_AT_ROUTE);
- proc_net_unregister(PROC_NET_ATIF);
+ proc_net_remove("appletalk");
+ proc_net_remove("atalk_route");
+ proc_net_remove("atalk_iface");

aarp_unregister_proc_fs();
#endif /* CONFIG_PROC_FS */
diff -urN linux-2.3.12/net/ax25/af_ax25.c linux-bird.proc/net/ax25/af_ax25.c
--- linux-2.3.12/net/ax25/af_ax25.c Tue Jul 6 04:35:16 1999
+++ linux-bird.proc/net/ax25/af_ax25.c Thu Jul 29 06:59:16 1999
@@ -1772,27 +1772,6 @@
EXPORT_SYMBOL(null_ax25_address);
EXPORT_SYMBOL(ax25_display_timer);

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_ax25_route = {
- PROC_NET_AX25_ROUTE, 10, "ax25_route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ax25_rt_get_info
-};
-static struct proc_dir_entry proc_ax25 = {
- PROC_NET_AX25, 4, "ax25",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ax25_get_info
-};
-static struct proc_dir_entry proc_ax25_calls = {
- PROC_NET_AX25_CALLS, 10, "ax25_calls",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ax25_uid_get_info
-};
-#endif
-
__initfunc(void ax25_proto_init(struct net_proto *pro))
{
sock_register(&ax25_family_ops);
@@ -1804,9 +1783,9 @@
#endif

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_ax25_route);
- proc_net_register(&proc_ax25);
- proc_net_register(&proc_ax25_calls);
+ proc_net_create("ax25_route", 0, ax25_rt_get_info);
+ proc_net_create("ax25", 0, ax25_get_info);
+ proc_net_create("ax25_calls", 0, ax25_uid_get_info);
#endif

printk(KERN_INFO "NET4: G4KLX/GW4PTS AX.25 for Linux. Version 0.37 for Linux NET4.0\n");
@@ -1826,10 +1805,9 @@
void cleanup_module(void)
{
#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_AX25_ROUTE);
- proc_net_unregister(PROC_NET_AX25);
- proc_net_unregister(PROC_NET_AX25_CALLS);
- proc_net_unregister(PROC_NET_AX25_ROUTE);
+ proc_net_remove("ax25_route");
+ proc_net_remove("ax25");
+ proc_net_remove("ax25_calls");
#endif
ax25_rt_free();
ax25_uid_free();
diff -urN linux-2.3.12/net/bridge/br.c linux-bird.proc/net/bridge/br.c
--- linux-2.3.12/net/bridge/br.c Tue Jul 6 04:35:17 1999
+++ linux-bird.proc/net/bridge/br.c Thu Jul 29 06:59:35 1999
@@ -829,14 +829,6 @@

return len;
}
-#ifdef CONFIG_PROC_FS
-struct proc_dir_entry proc_net_bridge= {
- PROC_NET_BRIDGE, 6, "bridge",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- br_tree_get_info
-};
-#endif
__initfunc(void br_init(void))
{ /* (4.8.1) */
int port_no;
@@ -893,9 +885,7 @@
br_stats.exempt_protocols = 0;
/*start_hello_timer();*/
/* Vova Oksman: register the function for the PROCfs "bridge" file */
-#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_bridge);
-#endif
+ proc_net_create("bridge", 0, br_tree_get_info);
}

static inline unsigned short make_port_id(int port_no)
diff -urN linux-2.3.12/net/core/dev.c linux-bird.proc/net/core/dev.c
--- linux-2.3.12/net/core/dev.c Mon Jun 21 13:45:34 1999
+++ linux-bird.proc/net/core/dev.c Thu Jul 29 06:59:59 1999
@@ -1869,26 +1869,6 @@
extern int cpm_enet_init(void);
#endif /* CONFIG_8xx */

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_dev = {
- PROC_NET_DEV, 3, "dev",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- dev_get_info
-};
-#endif
-
-#ifdef CONFIG_NET_RADIO
-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_wireless = {
- PROC_NET_WIRELESS, 8, "wireless",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- dev_get_wireless_info
-};
-#endif /* CONFIG_PROC_FS */
-#endif /* CONFIG_NET_RADIO */
-
__initfunc(int net_dev_init(void))
{
struct device *dev, **dp;
@@ -2010,7 +1990,7 @@
}

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_dev);
+ proc_net_create("dev", 0, dev_get_info);
{
struct proc_dir_entry *ent = create_proc_entry("net/dev_stat", 0, 0);
ent->read_proc = dev_proc_stats;
@@ -2019,7 +1999,7 @@

#ifdef CONFIG_NET_RADIO
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_wireless);
+ proc_net_create("wireless", 0, dev_get_wireless_info);
#endif /* CONFIG_PROC_FS */
#endif /* CONFIG_NET_RADIO */

diff -urN linux-2.3.12/net/decnet/af_decnet.c linux-bird.proc/net/decnet/af_decnet.c
--- linux-2.3.12/net/decnet/af_decnet.c Mon Jun 21 13:22:37 1999
+++ linux-bird.proc/net/decnet/af_decnet.c Thu Jul 29 07:00:19 1999
@@ -1986,23 +1986,11 @@
NULL,
};

-#ifdef CONFIG_PROC_FS
-struct proc_dir_entry decnet_linkinfo = {
- PROC_NET_DN_SKT, 6, "decnet", S_IFREG | S_IRUGO,
- 1, 0, 0, 0, &proc_net_inode_operations, dn_get_info
-};
-
#ifdef CONFIG_DECNET_RAW

extern int dn_raw_get_info(char *, char **, off_t, int, int);

-struct proc_dir_entry decnet_rawinfo = {
- PROC_NET_DN_RAW, 10, "decnet_raw", S_IFREG | S_IRUGO,
- 1, 0, 0, 0, &proc_net_inode_operations, dn_raw_get_info
-};
-
#endif /* CONFIG_DECNET_RAW */
-#endif /* CONFIG_PROC_FS */
static struct net_proto_family dn_family_ops = {
AF_DECnet,
dn_create
@@ -2040,11 +2028,9 @@
dev_add_pack(&dn_dix_packet_type);
register_netdevice_notifier(&dn_dev_notifier);

-#ifdef CONFIG_PROC_FS
- proc_net_register(&decnet_linkinfo);
+ proc_net_create("decnet", 0, dn_get_info);
#ifdef CONFIG_DECNET_RAW
- proc_net_register(&decnet_rawinfo);
-#endif
+ proc_net_create("decnet_raw", 0, dn_raw_get_info);
#endif
dn_dev_init();
dn_neigh_init();
@@ -2178,11 +2164,9 @@
dn_fib_cleanup();
#endif /* CONFIG_DECNET_ROUTER */

-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_DN_SKT);
+ proc_net_remove("decnet");
#ifdef CONFIG_DECNET_RAW
- proc_net_unregister(PROC_NET_DN_RAW);
-#endif
+ proc_net_remove("decnet_raw");
#endif

dev_remove_pack(&dn_dix_packet_type);
diff -urN linux-2.3.12/net/decnet/dn_dev.c linux-bird.proc/net/decnet/dn_dev.c
--- linux-2.3.12/net/decnet/dn_dev.c Mon Jun 21 13:31:33 1999
+++ linux-bird.proc/net/decnet/dn_dev.c Thu Jul 29 07:00:19 1999
@@ -1289,13 +1289,6 @@
return(len);
}

-static struct proc_dir_entry proc_net_decnet_dev = {
- PROC_NET_DN_DEV, 10, "decnet_dev",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- decnet_dev_get_info
-};
-
#endif /* CONFIG_PROC_FS */

#ifdef CONFIG_RTNETLINK
@@ -1346,7 +1339,7 @@
#endif /* CONFIG_RTNETLINK */

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_decnet_dev);
+ proc_net_create("decnet_dev", 0, decnet_dev_get_info);
#endif /* CONFIG_PROC_FS */

#ifdef CONFIG_SYSCTL
@@ -1378,7 +1371,7 @@
#endif /* CONFIG_SYSCTL */

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_DN_DEV);
+ proc_net_remove("decnet_dev");
#endif /* CONFIG_PROC_FS */

dn_dev_devices_off();
diff -urN linux-2.3.12/net/decnet/dn_fib.c linux-bird.proc/net/decnet/dn_fib.c
--- linux-2.3.12/net/decnet/dn_fib.c Tue Jul 6 04:35:19 1999
+++ linux-bird.proc/net/decnet/dn_fib.c Thu Jul 29 07:00:19 1999
@@ -774,19 +774,10 @@
return pinfo.len;
}

-static struct proc_dir_entry proc_net_decnet_route = {
- PROC_NET_DN_ROUTE, 12, "decnet_route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- decnet_rt_get_info
-};
-
#ifdef CONFIG_DECNET_MODULE
void dn_fib_cleanup(void)
{
-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_DN_ROUTE);
-#endif /* CONFIG_PROC_FS */
+ proc_net_remove("decnet_route");
}
#endif /* CONFIG_DECNET_MODULE */

@@ -794,11 +785,5 @@
void __init dn_fib_init(void)
{
memset(dn_fib_tables, 0, DN_NUM_TABLES * sizeof(struct dn_fib_table *));
-
-#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_decnet_route);
-#endif
-
+ proc_net_create("decnet_route", 0, decnet_rt_get_info);
}
-
-
diff -urN linux-2.3.12/net/decnet/dn_neigh.c linux-bird.proc/net/decnet/dn_neigh.c
--- linux-2.3.12/net/decnet/dn_neigh.c Mon Jun 21 13:45:35 1999
+++ linux-bird.proc/net/decnet/dn_neigh.c Thu Jul 29 07:00:19 1999
@@ -604,13 +604,6 @@
return len;
}

-static struct proc_dir_entry proc_net_dn_neigh = {
- PROC_NET_DN_ADJ, 12, "decnet_neigh",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- dn_neigh_get_info
-};
-
#endif

void __init dn_neigh_init(void)
@@ -618,16 +611,14 @@
neigh_table_init(&dn_neigh_table);

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_dn_neigh);
+ proc_net_create("decnet_neigh", 0, dn_neigh_get_info);
#endif /* CONFIG_PROC_FS */
}

#ifdef CONFIG_DECNET_MODULE
void dn_neigh_cleanup(void)
{
-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_DN_ADJ);
-#endif /* CONFIG_PROC_FS */
+ proc_net_remove("decnet_neigh");
neigh_table_clear(&dn_neigh_table);
}
#endif /* CONFIG_DECNET_MODULE */
diff -urN linux-2.3.12/net/decnet/dn_route.c linux-bird.proc/net/decnet/dn_route.c
--- linux-2.3.12/net/decnet/dn_route.c Mon Jun 21 13:18:08 1999
+++ linux-bird.proc/net/decnet/dn_route.c Thu Jul 29 07:00:20 1999
@@ -994,13 +994,6 @@
return(len);
}

-static struct proc_dir_entry proc_net_decnet_cache = {
- PROC_NET_DN_CACHE, 12, "decnet_cache",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- decnet_cache_get_info
-};
-
#endif /* CONFIG_PROC_FS */

void __init dn_route_init(void)
@@ -1012,7 +1005,7 @@
add_timer(&dn_route_timer);

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_decnet_cache);
+ proc_net_create("decnet_cache", 0, decnet_cache_get_info);
#endif /* CONFIG_PROC_FS */
}

@@ -1021,8 +1014,6 @@
{
del_timer(&dn_route_timer);
dn_run_flush(0);
-#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_DN_CACHE);
-#endif /* CONFIG_PROC_FS */
+ proc_net_remove("decnet_cache");
}
#endif /* CONFIG_DECNET_MODULE */
diff -urN linux-2.3.12/net/ipv4/af_inet.c linux-bird.proc/net/ipv4/af_inet.c
--- linux-2.3.12/net/ipv4/af_inet.c Sun Jul 4 00:00:47 1999
+++ linux-bird.proc/net/ipv4/af_inet.c Thu Jul 29 07:01:16 1999
@@ -1004,58 +1004,9 @@
inet_create
};

-
-#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_INET_RARP
-static struct proc_dir_entry proc_net_rarp = {
- PROC_NET_RARP, 4, "rarp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rarp_get_info
-};
-#endif /* RARP */
-static struct proc_dir_entry proc_net_raw = {
- PROC_NET_RAW, 3, "raw",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- raw_get_info
-};
-static struct proc_dir_entry proc_net_netstat = {
- PROC_NET_NETSTAT, 7, "netstat",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- netstat_get_info
-};
-static struct proc_dir_entry proc_net_snmp = {
- PROC_NET_SNMP, 4, "snmp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- snmp_get_info
-};
-static struct proc_dir_entry proc_net_sockstat = {
- PROC_NET_SOCKSTAT, 8, "sockstat",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- afinet_get_info
-};
-static struct proc_dir_entry proc_net_tcp = {
- PROC_NET_TCP, 3, "tcp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- tcp_get_info
-};
-static struct proc_dir_entry proc_net_udp = {
- PROC_NET_UDP, 3, "udp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- udp_get_info
-};
-#endif /* CONFIG_PROC_FS */
-
extern void tcp_init(void);
extern void tcp_v4_init(struct net_proto_family *);

-
/*
* Called by socket.c on kernel startup.
*/
@@ -1145,21 +1096,18 @@
#endif

#ifdef CONFIG_INET_RARP
- rarp_ioctl_hook = rarp_ioctl;
+ rarp_init();
#endif
/*
* Create all the /proc entries.
*/

#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_INET_RARP
- proc_net_register(&proc_net_rarp);
-#endif /* RARP */
- proc_net_register(&proc_net_raw);
- proc_net_register(&proc_net_snmp);
- proc_net_register(&proc_net_netstat);
- proc_net_register(&proc_net_sockstat);
- proc_net_register(&proc_net_tcp);
- proc_net_register(&proc_net_udp);
+ proc_net_create("raw", 0, raw_get_info);
+ proc_net_create("snmp", 0, snmp_get_info);
+ proc_net_create("netstat", 0, netstat_get_info);
+ proc_net_create("sockstat", 0, afinet_get_info);
+ proc_net_create("tcp", 0, tcp_get_info);
+ proc_net_create("udp", 0, udp_get_info);
#endif /* CONFIG_PROC_FS */
}
diff -urN linux-2.3.12/net/ipv4/arp.c linux-bird.proc/net/ipv4/arp.c
--- linux-2.3.12/net/ipv4/arp.c Mon Jun 21 13:45:37 1999
+++ linux-bird.proc/net/ipv4/arp.c Thu Jul 29 07:01:39 1999
@@ -1086,15 +1086,6 @@
NULL
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_arp = {
- PROC_NET_ARP, 3, "arp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- arp_get_info
-};
-#endif
-
__initfunc(void arp_init (void))
{
neigh_table_init(&arp_tbl);
@@ -1102,7 +1093,7 @@
dev_add_pack(&arp_packet_type);

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_arp);
+ proc_net_create("arp", 0, arp_get_info);
#endif
#ifdef CONFIG_SYSCTL
neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, NET_IPV4_NEIGH, "ipv4");
diff -urN linux-2.3.12/net/ipv4/fib_frontend.c linux-bird.proc/net/ipv4/fib_frontend.c
--- linux-2.3.12/net/ipv4/fib_frontend.c Mon Jun 21 13:45:37 1999
+++ linux-bird.proc/net/ipv4/fib_frontend.c Thu Jul 29 07:01:47 1999
@@ -605,12 +605,7 @@
__initfunc(void ip_fib_init(void))
{
#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_ROUTE, 5, "route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- fib_get_procinfo
- });
+ proc_net_create("route", 0, fib_get_procinfo);
#endif /* CONFIG_PROC_FS */

#ifndef CONFIG_IP_MULTIPLE_TABLES
diff -urN linux-2.3.12/net/ipv4/ip_fw.c linux-bird.proc/net/ipv4/ip_fw.c
--- linux-2.3.12/net/ipv4/ip_fw.c Mon Jun 21 12:37:06 1999
+++ linux-bird.proc/net/ipv4/ip_fw.c Thu Jul 29 07:26:10 1999
@@ -1687,21 +1687,6 @@
0 /* We don't even allow a fall through so we are last */
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_ipfwchains_chain = {
- PROC_NET_IPFW_CHAINS, sizeof(IP_FW_PROC_CHAINS)-1,
- IP_FW_PROC_CHAINS, S_IFREG | S_IRUSR | S_IWUSR, 1, 0, 0,
- 0, &proc_net_inode_operations, ip_chain_procinfo
-};
-
-static struct proc_dir_entry proc_net_ipfwchains_chainnames = {
- PROC_NET_IPFW_CHAIN_NAMES, sizeof(IP_FW_PROC_CHAIN_NAMES)-1,
- IP_FW_PROC_CHAIN_NAMES, S_IFREG | S_IRUSR | S_IWUSR, 1, 0, 0,
- 0, &proc_net_inode_operations, ip_chain_name_procinfo
-};
-
-#endif
-
__initfunc(void ip_fw_init(void))
{
#ifdef DEBUG_IP_FIRWALL_LOCKING
@@ -1715,10 +1700,10 @@
if(register_firewall(PF_INET,&ipfw_ops)<0)
panic("Unable to register IP firewall.\n");

-#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_ipfwchains_chain);
- proc_net_register(&proc_net_ipfwchains_chainnames);
-#endif
+ proc_net_create(IP_FW_PROC_CHAINS, S_IRUSR|S_IWUSR,
+ ip_chain_procinfo);
+ proc_net_create(IP_FW_PROC_CHAIN_NAMES, S_IRUSR|S_IWUSR,
+ ip_chain_name_procinfo);

#ifdef CONFIG_IP_FIREWALL_NETLINK
ipfwsk = netlink_kernel_create(NETLINK_FIREWALL, NULL);
diff -urN linux-2.3.12/net/ipv4/ip_masq.c linux-bird.proc/net/ipv4/ip_masq.c
--- linux-2.3.12/net/ipv4/ip_masq.c Wed Jun 30 17:10:22 1999
+++ linux-bird.proc/net/ipv4/ip_masq.c Thu Jul 29 07:02:23 1999
@@ -2399,18 +2399,13 @@
__initfunc(int ip_masq_init(void))
{
#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_IPMSQHST, 13, "ip_masquerade",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ip_msqhst_procinfo
- });
+ proc_net_create("ip_masquerade", 0, ip_msqhst_procinfo);
masq_proc_init();

ip_masq_proc_register(&(struct proc_dir_entry) {
0, 3, "tcp",
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
NULL, /* get_info */
NULL, /* fill_inode */
NULL, NULL, NULL,
@@ -2420,7 +2415,7 @@
ip_masq_proc_register(&(struct proc_dir_entry) {
0, 3, "udp",
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
NULL, /* get_info */
NULL, /* fill_inode */
NULL, NULL, NULL,
@@ -2430,7 +2425,7 @@
ip_masq_proc_register(&(struct proc_dir_entry) {
0, 4, "icmp",
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
NULL, /* get_info */
NULL, /* fill_inode */
NULL, NULL, NULL,
diff -urN linux-2.3.12/net/ipv4/ip_masq_app.c linux-bird.proc/net/ipv4/ip_masq_app.c
--- linux-2.3.12/net/ipv4/ip_masq_app.c Mon Jun 21 12:37:06 1999
+++ linux-bird.proc/net/ipv4/ip_masq_app.c Thu Jul 29 07:02:23 1999
@@ -476,7 +476,7 @@
static struct proc_dir_entry proc_net_ip_masq_app = {
PROC_NET_IP_MASQ_APP, 3, "app",
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
ip_masq_app_getinfo
};
#endif
diff -urN linux-2.3.12/net/ipv4/ip_masq_autofw.c linux-bird.proc/net/ipv4/ip_masq_autofw.c
--- linux-2.3.12/net/ipv4/ip_masq_autofw.c Mon Jun 21 12:37:06 1999
+++ linux-bird.proc/net/ipv4/ip_masq_autofw.c Thu Jul 29 07:02:23 1999
@@ -385,7 +385,7 @@
static struct proc_dir_entry autofw_proc_entry = {
0, 0, NULL,
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
autofw_procinfo
};

diff -urN linux-2.3.12/net/ipv4/ip_masq_mfw.c linux-bird.proc/net/ipv4/ip_masq_mfw.c
--- linux-2.3.12/net/ipv4/ip_masq_mfw.c Wed Jun 30 17:10:22 1999
+++ linux-bird.proc/net/ipv4/ip_masq_mfw.c Thu Jul 29 07:02:24 1999
@@ -423,7 +423,7 @@
/* 0, 0, NULL", */
0, 3, "mfw",
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
mfw_procinfo
};

diff -urN linux-2.3.12/net/ipv4/ip_masq_portfw.c linux-bird.proc/net/ipv4/ip_masq_portfw.c
--- linux-2.3.12/net/ipv4/ip_masq_portfw.c Wed Jun 30 17:10:23 1999
+++ linux-bird.proc/net/ipv4/ip_masq_portfw.c Thu Jul 29 07:02:24 1999
@@ -366,7 +366,7 @@
/* 0, 0, NULL", */
0, 6, "portfw", /* Just for compatibility, for now ... */
S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
+ 0, NULL,
portfw_procinfo
};

diff -urN linux-2.3.12/net/ipv4/ip_output.c linux-bird.proc/net/ipv4/ip_output.c
--- linux-2.3.12/net/ipv4/ip_output.c Mon Jun 21 12:37:06 1999
+++ linux-bird.proc/net/ipv4/ip_output.c Thu Jul 29 07:02:24 1999
@@ -961,18 +961,6 @@
};


-
-#ifdef CONFIG_PROC_FS
-#ifdef CONFIG_IP_MULTICAST
-static struct proc_dir_entry proc_net_igmp = {
- PROC_NET_IGMP, 4, "igmp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ip_mc_procinfo
-};
-#endif
-#endif
-
/*
* IP registers the packet type and then calls the subprotocol initialisers
*/
@@ -985,7 +973,7 @@

#ifdef CONFIG_PROC_FS
#ifdef CONFIG_IP_MULTICAST
- proc_net_register(&proc_net_igmp);
+ proc_net_create("igmp", 0, ip_mc_procinfo);
#endif
#endif
}
diff -urN linux-2.3.12/net/ipv4/ipmr.c linux-bird.proc/net/ipv4/ipmr.c
--- linux-2.3.12/net/ipv4/ipmr.c Mon Jun 21 13:45:40 1999
+++ linux-bird.proc/net/ipv4/ipmr.c Thu Jul 29 07:02:24 1999
@@ -1565,21 +1565,6 @@
return len;
}

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_ipmr_vif = {
- PROC_NET_IPMR_VIF, 9 ,"ip_mr_vif",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ipmr_vif_info
-};
-static struct proc_dir_entry proc_net_ipmr_mfc = {
- PROC_NET_IPMR_MFC, 11 ,"ip_mr_cache",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- ipmr_mfc_info
-};
-#endif
-
#ifdef CONFIG_IP_PIMSM_V2
struct inet_protocol pim_protocol =
{
@@ -1603,7 +1588,7 @@
printk(KERN_INFO "Linux IP multicast router 0.06 plus PIM-SM\n");
register_netdevice_notifier(&ip_mr_notifier);
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_ipmr_vif);
- proc_net_register(&proc_net_ipmr_mfc);
+ proc_net_create("ip_mr_vif", 0, ipmr_vif_info);
+ proc_net_create("ip_mr_cache", 0, ipmr_mfc_info);
#endif
}
diff -urN linux-2.3.12/net/ipv4/rarp.c linux-bird.proc/net/ipv4/rarp.c
--- linux-2.3.12/net/ipv4/rarp.c Mon Jun 21 12:37:06 1999
+++ linux-bird.proc/net/ipv4/rarp.c Thu Jul 29 07:02:24 1999
@@ -559,19 +559,13 @@
return len;
}

-struct proc_dir_entry proc_net_rarp = {
- PROC_NET_RARP, 4, "rarp",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rarp_get_info
-};
#endif

__initfunc(void
rarp_init(void))
{
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_rarp);
+ proc_net_create("rarp", 0, rarp_get_info);
#endif
rarp_ioctl_hook = rarp_ioctl;
}
@@ -588,7 +582,7 @@
{
struct rarp_table *rt, *rt_next;
#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_RARP);
+ proc_net_remove("rarp");
#endif
rarp_ioctl_hook = NULL;
cli();
diff -urN linux-2.3.12/net/ipv4/route.c linux-bird.proc/net/ipv4/route.c
--- linux-2.3.12/net/ipv4/route.c Mon Jun 21 13:45:40 1999
+++ linux-bird.proc/net/ipv4/route.c Thu Jul 29 07:02:25 1999
@@ -2038,12 +2038,7 @@
add_timer(&rt_periodic_timer);

#ifdef CONFIG_PROC_FS
- proc_net_register(&(struct proc_dir_entry) {
- PROC_NET_RTCACHE, 8, "rt_cache",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rt_cache_get_info
- });
+ proc_net_create("rt_cache", 0, rt_cache_get_info);
#ifdef CONFIG_NET_CLS_ROUTE
ent = create_proc_entry("net/rt_acct", 0, 0);
ent->read_proc = ip_rt_acct_read;
diff -urN linux-2.3.12/net/ipv6/addrconf.c linux-bird.proc/net/ipv6/addrconf.c
--- linux-2.3.12/net/ipv6/addrconf.c Mon Jun 21 13:45:42 1999
+++ linux-bird.proc/net/ipv6/addrconf.c Thu Jul 29 07:02:49 1999
@@ -1453,13 +1453,6 @@
return len;
}

-struct proc_dir_entry iface_proc_entry =
-{
- 0, 8, "if_inet6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, NULL,
- &iface_proc_info
-};
#endif /* CONFIG_PROC_FS */

/*
@@ -1865,7 +1858,7 @@
#endif

#ifdef CONFIG_PROC_FS
- proc_net_register(&iface_proc_entry);
+ proc_net_create("if_inet6", 0, iface_proc_info);
#endif

addr_chk_timer.expires = jiffies + ADDR_CHECK_FREQUENCY;
@@ -1928,8 +1921,6 @@
}
end_bh_atomic();

-#ifdef CONFIG_PROC_FS
- proc_net_unregister(iface_proc_entry.low_ino);
-#endif
+ proc_net_remove("if_inet6");
}
#endif /* MODULE */
diff -urN linux-2.3.12/net/ipv6/af_inet6.c linux-bird.proc/net/ipv6/af_inet6.c
--- linux-2.3.12/net/ipv6/af_inet6.c Sun Jul 4 00:00:52 1999
+++ linux-bird.proc/net/ipv6/af_inet6.c Thu Jul 29 07:02:49 1999
@@ -441,39 +441,6 @@
inet6_create
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_raw6 = {
- PROC_NET_RAW6, 4, "raw6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- raw6_get_info
-};
-static struct proc_dir_entry proc_net_tcp6 = {
- PROC_NET_TCP6, 4, "tcp6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- tcp6_get_info
-};
-static struct proc_dir_entry proc_net_udp6 = {
- PROC_NET_RAW6, 4, "udp6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- udp6_get_info
-};
-static struct proc_dir_entry proc_net_sockstat6 = {
- PROC_NET_SOCKSTAT6, 9, "sockstat6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- afinet6_get_info
-};
-static struct proc_dir_entry proc_net_snmp6 = {
- PROC_NET_SNMP6, 5, "snmp6",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- afinet6_get_snmp
-};
-#endif /* CONFIG_PROC_FS */
-
#ifdef MODULE
int ipv6_unload(void)
{
@@ -548,11 +515,11 @@

/* Create /proc/foo6 entries. */
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_raw6);
- proc_net_register(&proc_net_tcp6);
- proc_net_register(&proc_net_udp6);
- proc_net_register(&proc_net_sockstat6);
- proc_net_register(&proc_net_snmp6);
+ proc_net_create("raw6", 0, raw6_get_info);
+ proc_net_create("tcp6", 0, tcp6_get_info);
+ proc_net_create("udp6", 0, udp6_get_info);
+ proc_net_create("sockstat6", 0, afinet6_get_info);
+ proc_net_create("snmp6", 0, afinet6_get_snmp);
#endif

/* Now the userspace is allowed to create INET6 sockets. */
@@ -585,11 +552,11 @@
/* First of all disallow new sockets creation. */
sock_unregister(PF_INET6);
#ifdef CONFIG_PROC_FS
- proc_net_unregister(proc_net_raw6.low_ino);
- proc_net_unregister(proc_net_tcp6.low_ino);
- proc_net_unregister(proc_net_udp6.low_ino);
- proc_net_unregister(proc_net_sockstat6.low_ino);
- proc_net_unregister(proc_net_snmp6.low_ino);
+ proc_net_remove("raw6");
+ proc_net_remove("tcp6");
+ proc_net_remove("udp6");
+ proc_net_remove("sockstat6");
+ proc_net_remove("snmp6");
#endif
/* Cleanup code parts. */
sit_cleanup();
diff -urN linux-2.3.12/net/ipv6/ndisc.c linux-bird.proc/net/ipv6/ndisc.c
--- linux-2.3.12/net/ipv6/ndisc.c Mon Jun 21 13:45:43 1999
+++ linux-bird.proc/net/ipv6/ndisc.c Thu Jul 29 07:02:50 1999
@@ -1147,18 +1147,10 @@
return len;
}

-struct proc_dir_entry ndisc_proc_entry =
-{
- PROC_NET_NDISC, 5, "ndisc",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, NULL,
- &ndisc_get_info
-};
#endif
#endif /* CONFIG_PROC_FS */


-
__initfunc(int ndisc_init(struct net_proto_family *ops))
{
struct sock *sk;
@@ -1198,7 +1190,7 @@

#ifdef CONFIG_PROC_FS
#ifndef CONFIG_RTNETLINK
- proc_net_register(&ndisc_proc_entry);
+ proc_net_create("ndisc", 0, ndisc_get_info);
#endif
#endif
#ifdef CONFIG_SYSCTL
@@ -1212,7 +1204,7 @@
{
#ifdef CONFIG_PROC_FS
#ifndef CONFIG_RTNETLINK
- proc_net_unregister(ndisc_proc_entry.low_ino);
+ proc_net_remove("ndisc");
#endif
#endif
neigh_table_clear(&nd_tbl);
diff -urN linux-2.3.12/net/ipv6/route.c linux-bird.proc/net/ipv6/route.c
--- linux-2.3.12/net/ipv6/route.c Tue Jul 6 04:35:27 1999
+++ linux-bird.proc/net/ipv6/route.c Thu Jul 29 07:02:50 1999
@@ -1887,19 +1887,6 @@

return len;
}
-
-static struct proc_dir_entry proc_rt6_info = {
- PROC_NET_RT6, 10, "ipv6_route",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rt6_proc_info
-};
-static struct proc_dir_entry proc_rt6_stats = {
- PROC_NET_RT6_STATS, 9, "rt6_stats",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rt6_proc_stats
-};
#endif /* CONFIG_PROC_FS */

#ifdef CONFIG_SYSCTL
@@ -1956,8 +1943,8 @@
__initfunc(void ip6_route_init(void))
{
#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_rt6_info);
- proc_net_register(&proc_rt6_stats);
+ proc_net_create("ipv6_route", 0, rt6_proc_info);
+ proc_net_create("rt6_stats", 0, rt6_proc_stats);
#endif
#ifdef CONFIG_IPV6_NETLINK
netlink_attach(NETLINK_ROUTE6, rt6_msgrcv);
@@ -1968,8 +1955,8 @@
void ip6_route_cleanup(void)
{
#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_RT6);
- proc_net_unregister(PROC_NET_RT6_STATS);
+ proc_net_remove("ipv6_route");
+ proc_net_remove("rt6_stats");
#endif
#ifdef CONFIG_IPV6_NETLINK
netlink_detach(NETLINK_ROUTE6);
diff -urN linux-2.3.12/net/ipx/af_ipx.c linux-bird.proc/net/ipx/af_ipx.c
--- linux-2.3.12/net/ipx/af_ipx.c Tue Jul 6 04:35:28 1999
+++ linux-bird.proc/net/ipx/af_ipx.c Thu Jul 29 07:03:11 1999
@@ -2420,23 +2420,6 @@
extern void destroy_EII_client(struct datalink_proto *);
extern void destroy_8023_client(struct datalink_proto *);

-#ifdef CONFIG_PROC_FS
-struct proc_dir_entry ipx_procinfo = {
- PROC_NET_IPX, 3, "ipx", S_IFREG | S_IRUGO,
- 1, 0, 0, 0, &proc_net_inode_operations, ipx_get_info
-};
-
-struct proc_dir_entry ipx_if_procinfo = {
- PROC_NET_IPX_INTERFACE, 13, "ipx_interface", S_IFREG | S_IRUGO,
- 1, 0, 0, 0, &proc_net_inode_operations, ipx_interface_get_info
-};
-
-struct proc_dir_entry ipx_rt_procinfo = {
- PROC_NET_IPX_ROUTE, 9, "ipx_route", S_IFREG | S_IRUGO,
- 1, 0, 0, 0, &proc_net_inode_operations, ipx_rt_get_info
-};
-#endif
-
static unsigned char ipx_8022_type = 0xE0;
static unsigned char ipx_snap_id[5] = { 0x0, 0x0, 0x0, 0x81, 0x37 };

@@ -2461,9 +2444,9 @@
register_netdevice_notifier(&ipx_dev_notifier);

#ifdef CONFIG_PROC_FS
- proc_net_register(&ipx_procinfo);
- proc_net_register(&ipx_if_procinfo);
- proc_net_register(&ipx_rt_procinfo);
+ proc_net_create("ipx", 0, ipx_get_info);
+ proc_net_create("ipx_interface", 0, ipx_interface_get_info);
+ proc_net_create("ipx_route", 0, ipx_rt_get_info);
#endif

printk(KERN_INFO "NET4: Linux IPX 0.38 for NET4.0\n");
@@ -2514,9 +2497,9 @@
}

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_IPX_ROUTE);
- proc_net_unregister(PROC_NET_IPX_INTERFACE);
- proc_net_unregister(PROC_NET_IPX);
+ proc_net_remove("ipx_route");
+ proc_net_remove("ipx_interface");
+ proc_net_remove("ipx");
#endif

unregister_netdevice_notifier(&ipx_dev_notifier);
diff -urN linux-2.3.12/net/netrom/af_netrom.c linux-bird.proc/net/netrom/af_netrom.c
--- linux-2.3.12/net/netrom/af_netrom.c Tue Jul 6 04:35:33 1999
+++ linux-bird.proc/net/netrom/af_netrom.c Thu Jul 29 07:03:30 1999
@@ -1274,27 +1274,6 @@
0
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_nr = {
- PROC_NET_NR, 2, "nr",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- nr_get_info
-};
-static struct proc_dir_entry proc_net_nr_neigh = {
- PROC_NET_NR_NEIGH, 8, "nr_neigh",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- nr_neigh_get_info
-};
-static struct proc_dir_entry proc_net_nr_nodes = {
- PROC_NET_NR_NODES, 8, "nr_nodes",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- nr_nodes_get_info
-};
-#endif
-
static struct device *dev_nr;

__initfunc(void nr_proto_init(struct net_proto *pro))
@@ -1334,9 +1313,9 @@
nr_loopback_init();

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_nr);
- proc_net_register(&proc_net_nr_neigh);
- proc_net_register(&proc_net_nr_nodes);
+ proc_net_create("nr", 0, nr_get_info);
+ proc_net_create("nr_neigh", 0, nr_neigh_get_info);
+ proc_net_create("nr_nodes", 0, nr_nodes_get_info);
#endif
}

@@ -1361,9 +1340,9 @@
int i;

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_NR);
- proc_net_unregister(PROC_NET_NR_NEIGH);
- proc_net_unregister(PROC_NET_NR_NODES);
+ proc_net_remove("nr");
+ proc_net_remove("nr_neigh");
+ proc_net_remove("nr_nodes");
#endif
nr_loopback_clear();

diff -urN linux-2.3.12/net/rose/af_rose.c linux-bird.proc/net/rose/af_rose.c
--- linux-2.3.12/net/rose/af_rose.c Tue Jul 6 04:35:34 1999
+++ linux-bird.proc/net/rose/af_rose.c Thu Jul 29 07:04:09 1999
@@ -1464,33 +1464,6 @@
0
};

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_rose = {
- PROC_NET_RS, 4, "rose",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rose_get_info
-};
-static struct proc_dir_entry proc_net_rose_neigh = {
- PROC_NET_RS_NEIGH, 10, "rose_neigh",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rose_neigh_get_info
-};
-static struct proc_dir_entry proc_net_rose_nodes = {
- PROC_NET_RS_NODES, 10, "rose_nodes",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rose_nodes_get_info
-};
-static struct proc_dir_entry proc_net_rose_routes = {
- PROC_NET_RS_ROUTES, 11, "rose_routes",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- rose_routes_get_info
-};
-#endif
-
static struct device *dev_rose;

__initfunc(void rose_proto_init(struct net_proto *pro))
@@ -1533,10 +1506,10 @@
rose_add_loopback_neigh();

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_rose);
- proc_net_register(&proc_net_rose_neigh);
- proc_net_register(&proc_net_rose_nodes);
- proc_net_register(&proc_net_rose_routes);
+ proc_net_create("rose", 0, rose_get_info);
+ proc_net_create("rose_neigh", 0, rose_neigh_get_info);
+ proc_net_create("rose_nodes", 0, rose_nodes_get_info);
+ proc_net_create("rose_routes", 0, rose_routes_get_info);
#endif
}

@@ -1561,10 +1534,10 @@
int i;

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_RS);
- proc_net_unregister(PROC_NET_RS_NEIGH);
- proc_net_unregister(PROC_NET_RS_NODES);
- proc_net_unregister(PROC_NET_RS_ROUTES);
+ proc_net_remove("rose");
+ proc_net_remove("rose_neigh");
+ proc_net_remove("rose_nodes");
+ proc_net_remove("rose_routes");
#endif
rose_loopback_clear();

diff -urN linux-2.3.12/net/wanrouter/wanproc.c linux-bird.proc/net/wanrouter/wanproc.c
--- linux-2.3.12/net/wanrouter/wanproc.c Mon Jul 5 13:03:08 1999
+++ linux-bird.proc/net/wanrouter/wanproc.c Thu Jul 29 07:04:26 1999
@@ -193,16 +193,6 @@
name_root, /* .name */
0555 | S_IFDIR, /* .mode */
2, /* .nlink */
- 0, /* .uid */
- 0, /* .gid */
- 0, /* .size */
- &proc_dir_inode_operations, /* .ops */
- NULL, /* .get_info */
- NULL, /* .fill_node */
- NULL, /* .next */
- NULL, /* .parent */
- NULL, /* .subdir */
- NULL, /* .data */
};

/*
diff -urN linux-2.3.12/net/x25/af_x25.c linux-bird.proc/net/x25/af_x25.c
--- linux-2.3.12/net/x25/af_x25.c Tue Jul 6 04:35:38 1999
+++ linux-bird.proc/net/x25/af_x25.c Thu Jul 29 07:04:49 1999
@@ -1284,21 +1284,6 @@
}
}

-#ifdef CONFIG_PROC_FS
-static struct proc_dir_entry proc_net_x25 = {
- PROC_NET_X25, 3, "x25",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- x25_get_info
-};
-static struct proc_dir_entry proc_net_x25_routes = {
- PROC_NET_X25_ROUTES, 10, "x25_routes",
- S_IFREG | S_IRUGO, 1, 0, 0,
- 0, &proc_net_inode_operations,
- x25_routes_get_info
-};
-#endif
-
__initfunc(void x25_proto_init(struct net_proto *pro))
{
sock_register(&x25_family_ops);
@@ -1315,8 +1300,8 @@
#endif

#ifdef CONFIG_PROC_FS
- proc_net_register(&proc_net_x25);
- proc_net_register(&proc_net_x25_routes);
+ proc_net_create("x25", 0, x25_get_info);
+ proc_net_create("x25_routes", 0, x25_routes_get_info);
#endif
}

@@ -1353,8 +1338,8 @@
{

#ifdef CONFIG_PROC_FS
- proc_net_unregister(PROC_NET_X25);
- proc_net_unregister(PROC_NET_X25_ROUTES);
+ proc_net_remove("x25");
+ proc_net_remove("x25_routes");
#endif

x25_link_free();

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/