Index: linux/fs/nfsd/export.c
diff -u linux/fs/nfsd/export.c:1.6 linux/fs/nfsd/export.c:1.6.4.1
--- linux/fs/nfsd/export.c:1.6	Sat Nov  7 16:43:38 1998
+++ linux/fs/nfsd/export.c	Sat Nov  7 19:39:12 1998
@@ -615,6 +615,112 @@
 	return NULL;
 }
 
+struct flags {
+	int flag;
+	char *name[2];
+} expflags[] = {
+	{ NFSEXP_READONLY, {"ro", "rw"}},
+	{ NFSEXP_INSECURE_PORT, {"insecure", ""}},
+	{ NFSEXP_ROOTSQUASH, {"root_squash", "no_root_squash"}},
+	{ NFSEXP_ALLSQUASH, {"all_squash", ""}},
+	{ NFSEXP_ASYNC, {"async", ""}},
+	{ NFSEXP_GATHERED_WRITES, {"wdelay", ""}},
+	{ NFSEXP_UIDMAP, {"uidmap", ""}},
+	{ NFSEXP_KERBEROS, { "kerberos", ""}},
+	{ NFSEXP_SUNSECURE, { "sunsecure", ""}},
+	{ NFSEXP_CROSSMNT, {"crossmnt", ""}},
+	{ 0, {"", ""}}
+};
+
+static int
+exp_flags(char *buffer, int flag)
+{
+    int len = 0, first = 0;
+    struct flags *flg = expflags;
+
+    for (;flg->flag;flg++) {
+        int state = (flg->flag & flag)?0:1;
+        if (!flg->flag)
+		break;
+        if (*flg->name[state]) {
+		len += sprintf(buffer + len, "%s%s",
+                               first++?",":"", flg->name[state]);
+        }
+    }
+    return len;
+}
+
+int
+exp_procfs_exports(char *buffer, char **start, off_t offset,
+                             int length, int *eof, void *data)
+{
+	struct svc_clnthash	**hp, **head, *tmp;
+	struct svc_client	*clp;
+	svc_export *exp;
+	off_t	pos = 0;
+        off_t	begin = 0;
+        int	len = 0;
+	int	i,j;
+
+        len += sprintf(buffer, "# Version 1.0\n");
+        len += sprintf(buffer+len, "# Path Client(Flags) # IPs\n");
+
+	for (clp = clients; clp; clp = clp->cl_next) {
+		for (i = 0; i < NFSCLNT_EXPMAX; i++) {
+			exp = clp->cl_export[i];
+			while (exp) {
+				int first = 0;
+				len += sprintf(buffer+len, "%s\t", exp->ex_path);
+				len += sprintf(buffer+len, "%s", clp->cl_ident);
+				len += sprintf(buffer+len, "(");
+
+				len += exp_flags(buffer+len, exp->ex_flags);
+				len += sprintf(buffer+len, ") # ");
+				for (j = 0; j < clp->cl_naddr; j++) {
+					struct in_addr	addr = clp->cl_addr[j]; 
+
+					head = &clnt_hash[CLIENT_HASH(addr.s_addr)];
+					for (hp = head; (tmp = *hp) != NULL; hp = &(tmp->h_next)) {
+						if (tmp->h_addr.s_addr == addr.s_addr) {
+							if (first++) len += sprintf(buffer+len, "%s", " ");
+							if (tmp->h_client != clp)
+								len += sprintf(buffer+len, "(");
+							len += sprintf(buffer+len, "%d.%d.%d.%d",
+									htonl(addr.s_addr) >> 24 & 0xff,
+									htonl(addr.s_addr) >> 16 & 0xff,
+									htonl(addr.s_addr) >>  8 & 0xff,
+									htonl(addr.s_addr) >>  0 & 0xff);
+							if (tmp->h_client != clp)
+							  len += sprintf(buffer+len, ")");
+							break;
+						}
+					}
+				}
+				exp = exp->ex_next;
+
+				buffer[len++]='\n';
+
+				pos=begin+len;
+				if(pos<offset) {
+					len=0;
+					begin=pos;
+				}
+				if (pos > offset + length)
+					goto done;
+			}
+		}
+	}
+
+	*eof = 1;
+
+done:
+	*start = buffer + (offset - begin);
+	len -= (offset - begin);
+	if ( len > length )
+		len = length;
+	return len;
+}
+
 /*
  * Add or modify a client.
  * Change requests may involve the list of host addresses. The list of
Index: linux/fs/nfsd/nfsctl.c
diff -u linux/fs/nfsd/nfsctl.c:1.4 linux/fs/nfsd/nfsctl.c:1.4.4.1
--- linux/fs/nfsd/nfsctl.c:1.4	Sat Oct 24 11:36:37 1998
+++ linux/fs/nfsd/nfsctl.c	Sat Nov  7 19:39:13 1998
@@ -21,6 +21,7 @@
 #include <linux/version.h>
 #include <linux/unistd.h>
 #include <linux/malloc.h>
+#include <linux/proc_fs.h>
 
 #include <linux/nfs.h>
 #include <linux/sunrpc/svc.h>
@@ -53,6 +54,24 @@
 
 static int	initialized = 0;
 
+#ifdef CONFIG_PROC_FS
+
+int exp_procfs_exports(char *buffer, char **start, off_t offset,
+                             int length, int *eof, void *data);
+
+void proc_export_init()
+{
+	struct proc_dir_entry *nfs_export_ent = NULL;
+
+	if (!(nfs_export_ent = create_proc_entry("fs/nfs", S_IFDIR, 0)))
+		return;
+	if (!(nfs_export_ent = create_proc_entry("fs/nfs/exports", 0, 0)))
+		return;
+	nfs_export_ent->read_proc = exp_procfs_exports;
+}
+
+#endif
+
 /*
  * Initialize nfsd
  */
@@ -68,6 +87,9 @@
 	nfsd_lockd_init();	/* lockd->nfsd callbacks */
 	nfsd_racache_init();	/* Readahead param cache */
 	nfsd_fh_init();		/* FH table */
+#ifdef CONFIG_PROC_FS
+	proc_export_init();
+#endif
 	initialized = 1;
 }
 
@@ -290,6 +312,8 @@
 	nfsd_cache_shutdown();
 	nfsd_fh_free();
 #ifdef CONFIG_PROC_FS
+	remove_proc_entry("fs/nfs/exports", NULL);
+	remove_proc_entry("fs/nfs", NULL);
 	nfsd_stat_shutdown();
 #endif
 	nfsd_lockd_shutdown();
