Subject: Utilizing FS_OPS() macro in bootloaders
To: None <netbsd-ports@netbsd.org>
From: Bang Jun-Young <junyoung@netbsd.org>
List: netbsd-ports
Date: 06/23/2005 16:25:45
--Boundary-00=_5PmuCjP4sfgHIMW
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

The attached patch utilizes FS_OPS() macro for file_system definitions
in bootloaders. FS_OPS() can be found in sys/lib/libsa/stand.h.

Since there are too many ports covered by it, I can't check its validity
by crossbuilding all of them. So I need your comments before I check it in.

Jun-Young

P.S.: I'm not subscribed to netbsd-ports, so please add me to CC: when
you reply.

--Boundary-00=_5PmuCjP4sfgHIMW
Content-Type: text/x-diff;
  charset="us-ascii";
  name="FS_OPS.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="FS_OPS.diff"

Index: sys/arch/alpha/stand/boot/filesystem.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/stand/boot/filesystem.c,v
retrieving revision 1.8
diff -u -r1.8 filesystem.c
--- sys/arch/alpha/stand/boot/filesystem.c	23 Feb 2003 23:23:07 -0000	1.8
+++ sys/arch/alpha/stand/boot/filesystem.c	22 Jun 2005 17:40:43 -0000
@@ -38,19 +38,14 @@
 #include <lib/libsa/ustarfs.h>
 #include <lib/libsa/cd9660.h>
 #include <lib/libsa/lfs.h>
- 
+
 struct fs_ops file_system[] = {
-    { ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek,
-	ustarfs_stat },	/* this one can work from tape, so put it first */
-    { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek,
-	ufs_stat },
-    { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	cd9660_stat },
-    { lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	lfsv1_stat },
-    { lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	lfsv2_stat },
+	FS_OPS(ustarfs),	/* this can work from tape, so put it first */
+	FS_OPS(ufs),
+	FS_OPS(cd9660),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
 };
- 
+
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
 
Index: sys/arch/amiga/stand/bootblock/boot/xd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/stand/bootblock/boot/xd.c,v
retrieving revision 1.5
diff -u -r1.5 xd.c
--- sys/arch/amiga/stand/bootblock/boot/xd.c	26 Jan 2002 13:18:58 -0000	1.5
+++ sys/arch/amiga/stand/bootblock/boot/xd.c	22 Jun 2005 17:40:44 -0000
@@ -53,9 +53,8 @@
 };
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek,
-	  ustarfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(ustarfs),
 };
 
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
Index: sys/arch/arc/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arc/stand/boot/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/arc/stand/boot/conf.c	18 Apr 2005 16:27:54 -0000	1.1
+++ sys/arch/arc/stand/boot/conf.c	22 Jun 2005 17:40:44 -0000
@@ -92,21 +92,16 @@
 #endif
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ dosfs_open, dosfs_close, dosfs_read, dosfs_write, dosfs_seek,
-	    dosfs_stat },
-	{ lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	    lfsv1_stat },
-	{ lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	    lfsv2_stat },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat },
+	FS_OPS(ufs),
+	FS_OPS(dosfs),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
+	FS_OPS(cd9660),
 #ifdef SUPPORT_USTARFS
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat },
+	FS_OPS(ustarfs),
 #endif
 #ifdef BOOTNET
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 #endif
 };
 
Index: sys/arch/atari/stand/bootxx/filesystem.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/stand/bootxx/filesystem.c,v
retrieving revision 1.3
diff -u -r1.3 filesystem.c
--- sys/arch/atari/stand/bootxx/filesystem.c	13 Oct 2001 20:26:48 -0000	1.3
+++ sys/arch/atari/stand/bootxx/filesystem.c	22 Jun 2005 17:40:45 -0000
@@ -33,9 +33,9 @@
 
 #include <stand.h>
 #include <ufs.h>
- 
+
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
+	FS_OPS(ufs),
 };
- 
+
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
Index: sys/arch/bebox/stand/boot/filesystem.c
===================================================================
RCS file: /cvsroot/src/sys/arch/bebox/stand/boot/filesystem.c,v
retrieving revision 1.2
diff -u -r1.2 filesystem.c
--- sys/arch/bebox/stand/boot/filesystem.c	28 Jun 1999 01:20:44 -0000	1.2
+++ sys/arch/bebox/stand/boot/filesystem.c	22 Jun 2005 17:40:46 -0000
@@ -44,10 +44,10 @@
 #endif
 
 struct fs_ops file_system[] = {
-{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek, cd9660_stat },
+	FS_OPS(ufs),
+	FS_OPS(cd9660),
 #if 0
-{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 #endif
 };
 
Index: sys/arch/cobalt/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/stand/boot/conf.c,v
retrieving revision 1.2
diff -u -r1.2 conf.c
--- sys/arch/cobalt/stand/boot/conf.c	7 Aug 2003 16:27:18 -0000	1.2
+++ sys/arch/cobalt/stand/boot/conf.c	22 Jun 2005 17:40:46 -0000
@@ -60,8 +60,10 @@
  * Filesystem configuration
  */
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-/*	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat }*/
+	FS_OPS(ufs),
+#if 0
+	FS_OPS(nfs),
+#endif
 };
 
 int nfsys = sizeof(file_system) / sizeof(file_system[0]);
Index: sys/arch/hp300/stand/common/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/stand/common/conf.c,v
retrieving revision 1.8
diff -u -r1.8 conf.c
--- sys/arch/hp300/stand/common/conf.c	20 Feb 2005 13:59:27 -0000	1.8
+++ sys/arch/hp300/stand/common/conf.c	22 Jun 2005 17:40:46 -0000
@@ -137,18 +137,9 @@
 /*
  * Filesystem configuration
  */
-struct fs_ops file_system_rawfs[] = {
-	{ rawfs_open, rawfs_close, rawfs_read, rawfs_write, rawfs_seek,
-	    rawfs_stat },
-};
-
-struct fs_ops file_system_ufs[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-};
-
-struct fs_ops file_system_nfs[] = {
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
-};
+struct fs_ops file_system_rawfs[] = { FS_OPS(rawfs); }
+struct fs_ops file_system_ufs[] = { FS_OPS(ufs); }
+struct fs_ops file_system_nfs[] = { FS_OPS(nfs); }
 
 struct fs_ops file_system[1];
 int	nfsys = 1;		/* we always know which one we want */
@@ -156,7 +147,7 @@
 #if 0
 /*
  * Inititalize controllers
- * 
+ *
  * XXX this should be a table
  */
 void ctlrinit(void)
Index: sys/arch/hp700/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/stand/boot/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/hp700/stand/boot/conf.c	6 Jun 2002 19:48:11 -0000	1.1
+++ sys/arch/hp700/stand/boot/conf.c	22 Jun 2005 17:40:46 -0000
@@ -42,12 +42,9 @@
 int	debug = 0;
 
 struct fs_ops file_system[] = {
-	{ lif_open,    lif_close,    lif_read,    lif_write,    lif_seek,
-	  lif_stat    },
-	{ ufs_open,    ufs_close,    ufs_read,    ufs_write,    ufs_seek,
-	  ufs_stat    },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	  cd9660_stat },
+	FS_OPS(lif),
+	FS_OPS(ufs),
+	FS_OPS(cd9660),
 };
 int nfsys = NENTS(file_system);
 
Index: sys/arch/i386/stand/pxeboot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/pxeboot/conf.c,v
retrieving revision 1.2
diff -u -r1.2 conf.c
--- sys/arch/i386/stand/pxeboot/conf.c	12 Mar 2003 17:33:55 -0000	1.2
+++ sys/arch/i386/stand/pxeboot/conf.c	22 Jun 2005 17:40:47 -0000
@@ -51,15 +51,11 @@
 #include "pxeboot.h"
 
 #ifdef SUPPORT_NFS
-struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+struct fs_ops file_system_nfs = FS_OPS(nfs);
 #endif
 
 #ifdef SUPPORT_TFTP
-struct fs_ops file_system_tftp = {
-	tftp_open, tftp_close, tftp_read, tftp_write, tftp_seek, tftp_stat
-};
+struct fs_ops file_system_tftp = FS_OPS(tftp);
 #endif
 
 struct pxeboot_fstab pxeboot_fstab[] = {
Index: sys/arch/macppc/stand/ofwboot/ofdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/stand/ofwboot/ofdev.c,v
retrieving revision 1.14
diff -u -r1.14 ofdev.c
--- sys/arch/macppc/stand/ofwboot/ofdev.c	26 Dec 2003 13:43:29 -0000	1.14
+++ sys/arch/macppc/stand/ofwboot/ofdev.c	22 Jun 2005 17:40:47 -0000
@@ -151,23 +151,11 @@
 };
 int ndevs = sizeof devsw / sizeof devsw[0];
 
-static struct fs_ops file_system_ufs = {
-	ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat
-};
-static struct fs_ops file_system_hfs = {
-	hfs_open, hfs_close, hfs_read, hfs_write, hfs_seek, hfs_stat
-};
-static struct fs_ops file_system_ustarfs = {
-	ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek,
-	    ustarfs_stat
-};
-static struct fs_ops file_system_cd9660 = {
-	cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat
-};
-static struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+static struct fs_ops file_system_ufs = FS_OPS(ufs);
+static struct fs_ops file_system_hfs = FS_OPS(hfs);
+static struct fs_ops file_system_ustarfs = FS_OPS(ustarfs);
+static struct fs_ops file_system_cd9660 = FS_OPS(cd9660);
+static struct fs_ops file_system_nfs = FS_OPS(nfs);
 
 struct fs_ops file_system[4];
 int nfsys;
Index: sys/arch/mipsco/stand/common/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mipsco/stand/common/conf.c,v
retrieving revision 1.3
diff -u -r1.3 conf.c
--- sys/arch/mipsco/stand/common/conf.c	7 Aug 2003 16:28:38 -0000	1.3
+++ sys/arch/mipsco/stand/common/conf.c	22 Jun 2005 17:40:48 -0000
@@ -89,17 +89,13 @@
 #endif
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	    lfsv1_stat },
-	{ lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	    lfsv2_stat },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat },
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
+	FS_OPS(cd9660),
+	FS_OPS(ustarfs),
 #ifdef BOOTNET
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 #endif
 };
 
Index: sys/arch/mvme68k/stand/bootsd/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/stand/bootsd/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/mvme68k/stand/bootsd/conf.c	17 May 1996 20:04:48 -0000	1.1
+++ sys/arch/mvme68k/stand/bootsd/conf.c	22 Jun 2005 17:40:48 -0000
@@ -8,7 +8,7 @@
 #include "libsa.h"
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
+	FS_OPS(ufs),
 };
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
 
Index: sys/arch/mvme68k/stand/bootst/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/stand/bootst/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/mvme68k/stand/bootst/conf.c	28 May 1996 15:23:54 -0000	1.1
+++ sys/arch/mvme68k/stand/bootst/conf.c	22 Jun 2005 17:40:48 -0000
@@ -5,16 +5,13 @@
 #include <dev_tape.h>
 
 struct fs_ops file_system[] = {
-	{
-		rawfs_open, rawfs_close, rawfs_read,
-		rawfs_write, rawfs_seek, rawfs_stat,
-	},
+	FS_OPS(rawfs),
 };
-int nfsys = 1;
+int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "tape", tape_strategy, tape_open, tape_close, tape_ioctl },
 };
-int	ndevs = 1;
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 int debug;
Index: sys/arch/mvmeppc/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvmeppc/stand/boot/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/mvmeppc/stand/boot/conf.c	27 Feb 2002 21:02:26 -0000	1.1
+++ sys/arch/mvmeppc/stand/boot/conf.c	22 Jun 2005 17:40:48 -0000
@@ -9,14 +9,14 @@
 #include <dev_net.h>
 
 struct fs_ops file_system[] = {
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 };
 int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "net",  net_strategy,  net_open,  net_close,  net_ioctl },
 };
-int	ndevs = sizeof(devsw) / sizeof(devsw[0]);
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 extern struct netif_driver bug_driver;
 
Index: sys/arch/news68k/stand/boot/devopen.c
===================================================================
RCS file: /cvsroot/src/sys/arch/news68k/stand/boot/devopen.c,v
retrieving revision 1.6
diff -u -r1.6 devopen.c
--- sys/arch/news68k/stand/boot/devopen.c	4 Sep 2004 13:43:12 -0000	1.6
+++ sys/arch/news68k/stand/boot/devopen.c	22 Jun 2005 17:40:48 -0000
@@ -49,9 +49,8 @@
 int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat }
+	FS_OPS(ufs),
+	FS_OPS(ustarfs),
 };
 int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
Index: sys/arch/newsmips/stand/boot/devopen.c
===================================================================
RCS file: /cvsroot/src/sys/arch/newsmips/stand/boot/devopen.c,v
retrieving revision 1.7
diff -u -r1.7 devopen.c
--- sys/arch/newsmips/stand/boot/devopen.c	6 Feb 2005 02:18:03 -0000	1.7
+++ sys/arch/newsmips/stand/boot/devopen.c	22 Jun 2005 17:40:49 -0000
@@ -55,17 +55,10 @@
 };
 int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
-struct fs_ops file_system_ufs = {
-	ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat
-};
-struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+struct fs_ops file_system_ufs = FS_OPS(ufs);
+struct fs_ops file_system_nfs = FS_OPS(nfs);
 #ifdef SUPPORT_USTARFS
-struct fs_ops file_system_ustarfs = {
-	ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat
-};
+struct fs_ops file_system_ustarfs = FS_OPS(ustarfs);
 struct fs_ops file_system[2];
 #else
 struct fs_ops file_system[1];
Index: sys/arch/next68k/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/next68k/stand/boot/conf.c,v
retrieving revision 1.5
diff -u -r1.5 conf.c
--- sys/arch/next68k/stand/boot/conf.c	19 Jan 2005 01:58:21 -0000	1.5
+++ sys/arch/next68k/stand/boot/conf.c	22 Jun 2005 17:40:49 -0000
@@ -78,8 +78,8 @@
  * Filesystem configuration
  */
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(nfs),
 };
 
 int nfsys = sizeof(file_system) / sizeof(file_system[0]);
Index: sys/arch/ofppc/stand/ofwboot/ofdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ofppc/stand/ofwboot/ofdev.c,v
retrieving revision 1.11
diff -u -r1.11 ofdev.c
--- sys/arch/ofppc/stand/ofwboot/ofdev.c	8 Oct 2003 04:25:45 -0000	1.11
+++ sys/arch/ofppc/stand/ofwboot/ofdev.c	22 Jun 2005 17:40:49 -0000
@@ -171,20 +171,10 @@
 };
 int ndevs = sizeof devsw / sizeof devsw[0];
 
-static struct fs_ops file_system_ufs = {
-	ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat
-};
-static struct fs_ops file_system_cd9660 = {
-	cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat
-};
-static struct fs_ops file_system_dosfs = {
-	dosfs_open, dosfs_close, dosfs_read, dosfs_write, dosfs_seek,
-	    dosfs_stat
-};
-static struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+static struct fs_ops file_system_ufs = FS_OPS(ufs);
+static struct fs_ops file_system_cd9660 = FS_OPS(cd9660);
+static struct fs_ops file_system_dosfs = FS_OPS(dosfs);
+static struct fs_ops file_system_nfs = FS_OPS(nfs);
 
 struct fs_ops file_system[3];
 int nfsys;
Index: sys/arch/pc532/stand/common/filesystem.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pc532/stand/common/filesystem.c,v
retrieving revision 1.2
diff -u -r1.2 filesystem.c
--- sys/arch/pc532/stand/common/filesystem.c	6 Dec 2003 13:09:01 -0000	1.2
+++ sys/arch/pc532/stand/common/filesystem.c	22 Jun 2005 17:40:49 -0000
@@ -35,7 +35,7 @@
 #include <lib/libsa/ufs.h>
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
+	FS_OPS(ufs),
 };
 
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
Index: sys/arch/pmax/stand/common/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pmax/stand/common/conf.c,v
retrieving revision 1.22
diff -u -r1.22 conf.c
--- sys/arch/pmax/stand/common/conf.c	7 Aug 2003 16:29:15 -0000	1.22
+++ sys/arch/pmax/stand/common/conf.c	22 Jun 2005 17:40:49 -0000
@@ -98,17 +98,13 @@
 #endif
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	    lfsv1_stat },
-	{ lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	    lfsv2_stat },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat },
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
+	FS_OPS(cd9660),
+	FS_OPS(ustarfs),
 #ifdef BOOTNET
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 #endif
 };
 
Index: sys/arch/sbmips/stand/boot/filesystem.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sbmips/stand/boot/filesystem.c,v
retrieving revision 1.2
diff -u -r1.2 filesystem.c
--- sys/arch/sbmips/stand/boot/filesystem.c	23 Feb 2003 23:23:09 -0000	1.2
+++ sys/arch/sbmips/stand/boot/filesystem.c	22 Jun 2005 17:40:49 -0000
@@ -38,19 +38,14 @@
 #include <lib/libsa/ustarfs.h>
 #include <lib/libsa/cd9660.h>
 #include <lib/libsa/lfs.h>
- 
+
 struct fs_ops file_system[] = {
-    { ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek,
-	ustarfs_stat },	/* this one can work from tape, so put it first */
-    { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek,
-	ufs_stat },
-    { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	cd9660_stat },
-    { lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	lfsv1_stat },
-    { lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	lfsv2_stat },
+	FS_OPS(ustarfs),	/* this can work from tape, so put it first */
+	FS_OPS(ufs),
+	FS_OPS(cd9660),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
 };
- 
+
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
 
Index: sys/arch/sbmips/stand/netboot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sbmips/stand/netboot/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/sbmips/stand/netboot/conf.c	9 Nov 2002 06:20:41 -0000	1.1
+++ sys/arch/sbmips/stand/netboot/conf.c	22 Jun 2005 17:40:49 -0000
@@ -8,14 +8,14 @@
 #include <lib/libsa/dev_net.h>
 
 struct fs_ops file_system[] = {
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 };
-int nfsys = 1;
+int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "net",  net_strategy,  net_open,  net_close,  net_ioctl },
 };
-int	ndevs = 1;
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 extern struct netif_driver prom_netif_driver;
 
Index: sys/arch/sgimips/stand/common/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/stand/common/conf.c,v
retrieving revision 1.3
diff -u -r1.3 conf.c
--- sys/arch/sgimips/stand/common/conf.c	7 Aug 2003 16:29:27 -0000	1.3
+++ sys/arch/sgimips/stand/common/conf.c	22 Jun 2005 17:40:49 -0000
@@ -90,19 +90,15 @@
 #endif
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	    lfsv1_stat },
-	{ lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	    lfsv2_stat },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat },
+	FS_OPS(ufs),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
+	FS_OPS(cd9660),
 #if 0
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat },
+	FS_OPS(ustarfs),
 #endif
 #ifdef BOOTNET
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 #endif
 };
 
Index: sys/arch/shark/stand/ofwboot/ofdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/shark/stand/ofwboot/ofdev.c,v
retrieving revision 1.5
diff -u -r1.5 ofdev.c
--- sys/arch/shark/stand/ofwboot/ofdev.c	22 Jun 2005 16:35:58 -0000	1.5
+++ sys/arch/shark/stand/ofwboot/ofdev.c	22 Jun 2005 17:40:49 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofdev.c,v 1.5 2005/06/22 16:35:58 junyoung Exp $	*/
+/*	$NetBSD: ofdev.c,v 1.4 2004/06/30 15:43:57 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -155,20 +155,10 @@
 };
 int ndevs = sizeof devsw / sizeof devsw[0];
 
-static struct fs_ops file_system_ufs = {
-	ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat
-};
-static struct fs_ops file_system_cd9660 = {
-	cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat
-};
-static struct fs_ops file_system_dosfs = {
-	dosfs_open, dosfs_close, dosfs_read, dosfs_write, dosfs_seek,
-	    dosfs_stat
-};
-static struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+static struct fs_ops file_system_ufs = FS_OPS(ufs);
+static struct fs_ops file_system_cd9660 = FS_OPS(cd9660);
+static struct fs_ops file_system_dosfs = FS_OPS(dosfs);
+static struct fs_ops file_system_nfs = FS_OPS(nfs);
 
 struct fs_ops file_system[3];
 int nfsys;
Index: sys/arch/sparc/stand/ofwboot/ofdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/ofwboot/ofdev.c,v
retrieving revision 1.7
diff -u -r1.7 ofdev.c
--- sys/arch/sparc/stand/ofwboot/ofdev.c	22 Jun 2005 16:38:18 -0000	1.7
+++ sys/arch/sparc/stand/ofwboot/ofdev.c	22 Jun 2005 17:40:52 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofdev.c,v 1.7 2005/06/22 16:38:18 junyoung Exp $	*/
+/*	$NetBSD: ofdev.c,v 1.6 2004/11/13 08:13:58 grant Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -196,20 +196,13 @@
 int ndevs = sizeof devsw / sizeof devsw[0];
 
 #ifdef SPARC_BOOT_UFS
-static struct fs_ops file_system_ufs = {
-	ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat
-};
+static struct fs_ops file_system_ufs = FS_OPS(ufs);
 #endif
 #ifdef SPARC_BOOT_HSFS
-static struct fs_ops file_system_cd9660 = {
-	cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	    cd9660_stat
-};
+static struct fs_ops file_system_cd9660 = FS_OPS(cd9660);
 #endif
 #ifdef NETBOOT
-static struct fs_ops file_system_nfs = {
-	nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat
-};
+static struct fs_ops file_system_nfs = FS_OPS(nfs);
 #endif
 
 struct fs_ops file_system[3];
Index: sys/arch/sun68k/stand/netboot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun68k/stand/netboot/conf.c,v
retrieving revision 1.1
diff -u -r1.1 conf.c
--- sys/arch/sun68k/stand/netboot/conf.c	14 Jun 2001 12:57:16 -0000	1.1
+++ sys/arch/sun68k/stand/netboot/conf.c	22 Jun 2005 17:40:53 -0000
@@ -8,14 +8,14 @@
 #include "dev_net.h"
 
 struct fs_ops file_system[] = {
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
+	FS_OPS(nfs),
 };
-int nfsys = 1;
+int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "net",  net_strategy,  net_open,  net_close,  net_ioctl },
 };
-int	ndevs = 1;
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 int
 main() {
Index: sys/arch/sun68k/stand/tapeboot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun68k/stand/tapeboot/conf.c,v
retrieving revision 1.2
diff -u -r1.2 conf.c
--- sys/arch/sun68k/stand/tapeboot/conf.c	15 May 2002 04:07:44 -0000	1.2
+++ sys/arch/sun68k/stand/tapeboot/conf.c	22 Jun 2005 17:40:53 -0000
@@ -5,17 +5,14 @@
 #include <dev_tape.h>
 
 struct fs_ops file_system[] = {
-	{
-		rawfs_open, rawfs_close, rawfs_read,
-		rawfs_write, rawfs_seek, rawfs_stat,
-	},
+	FS_OPS(rawfs),
 };
-int nfsys = 1;
+int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "tape", tape_strategy, tape_open, tape_close, tape_ioctl },
 };
-int	ndevs = 1;
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 #ifdef DEBUG
 int debug;
Index: sys/arch/sun68k/stand/ufsboot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun68k/stand/ufsboot/conf.c,v
retrieving revision 1.2
diff -u -r1.2 conf.c
--- sys/arch/sun68k/stand/ufsboot/conf.c	22 Jan 2005 15:36:12 -0000	1.2
+++ sys/arch/sun68k/stand/ufsboot/conf.c	22 Jun 2005 17:40:53 -0000
@@ -5,14 +5,14 @@
 #include <dev_disk.h>
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
+	FS_OPS(ufs),
 };
-int nfsys = 1;
+int nfsys = sizeof(file_system) / sizeof(file_system[0]);
 
 struct devsw devsw[] = {
 	{ "disk", disk_strategy, disk_open, disk_close, disk_ioctl },
 };
-int	ndevs = 1;
+int ndevs = sizeof(devsw) / sizeof(devsw[0]);
 
 int
 main(void)
Index: sys/arch/vax/boot/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/boot/boot/conf.c,v
retrieving revision 1.11
diff -u -r1.11 conf.c
--- sys/arch/vax/boot/boot/conf.c	6 Jan 2004 17:01:48 -0000	1.11
+++ sys/arch/vax/boot/boot/conf.c	22 Jun 2005 17:40:53 -0000
@@ -88,12 +88,10 @@
 int     ndevs = (sizeof(devsw)/sizeof(devsw[0]));
 
 struct fs_ops file_system[] = {
-	{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat },
-	{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
-	{ cd9660_open, cd9660_close, cd9660_read, cd9660_write,
-	    cd9660_seek, cd9660_stat },
-	{ ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write,
-	    ustarfs_seek, ustarfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(nfs),
+	FS_OPS(cd9660),
+	FS_OPS(ustarfs),
 };
 
 int nfsys = (sizeof(file_system) / sizeof(struct fs_ops));
Index: sys/arch/x68k/stand/boot/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x68k/stand/boot/conf.c,v
retrieving revision 1.4
diff -u -r1.4 conf.c
--- sys/arch/x68k/stand/boot/conf.c	23 Feb 2003 23:23:10 -0000	1.4
+++ sys/arch/x68k/stand/boot/conf.c	22 Jun 2005 17:40:53 -0000
@@ -52,18 +52,13 @@
 };
 
 struct fs_ops file_system[] = {
-    { ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek,
-	ufs_stat },
-    { lfsv1_open, lfsv1_close, lfsv1_read, lfsv1_write, lfsv1_seek,
-	lfsv1_stat },
-    { lfsv2_open, lfsv2_close, lfsv2_read, lfsv2_write, lfsv2_seek,
-	lfsv2_stat },
-    { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
-	cd9660_stat },
-    { ustarfs_open, ustarfs_close, ustarfs_read, ustarfs_write, ustarfs_seek,
-	ustarfs_stat },
+	FS_OPS(ufs),
+	FS_OPS(lfsv1),
+	FS_OPS(lfsv2),
+	FS_OPS(cd9660),
+	FS_OPS(ustarfs),
 };
- 
+
 int nfsys = sizeof(file_system)/sizeof(struct fs_ops);
 
 struct open_file files[SOPEN_MAX];

--Boundary-00=_5PmuCjP4sfgHIMW--