Move the call to nfs_boot_getfh() from nfs_vfsops.c to nfs_boot.c trunk
authorgwr <gwr@NetBSD.org>
Tue, 09 Sep 1997 21:39:17 +0000
branchtrunk
changeset 31258 7788ccffcbc8
parent 31257 b0e02e305a2b
child 31259 1b78333b928f
Move the call to nfs_boot_getfh() from nfs_vfsops.c to nfs_boot.c (just for better isolation - it can now be static)
sys/nfs/nfs_boot.c
sys/nfs/nfs_vfsops.c
sys/nfs/nfsdiskless.h
--- a/sys/nfs/nfs_boot.c	Tue Sep 09 21:36:35 1997 +0000
+++ b/sys/nfs/nfs_boot.c	Tue Sep 09 21:39:17 1997 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_boot.c,v 1.36 1997/09/02 21:33:17 gwr Exp $	*/
+/*	$NetBSD: nfs_boot.c,v 1.37 1997/09/09 21:39:17 gwr Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,6 @@
 
 #include <net/if.h>
 #include <net/route.h>
-
 #include <net/if_ether.h>
 #include <net/if_types.h>
 
@@ -64,12 +63,11 @@
 #include <netinet/if_inarp.h>
 
 #include <nfs/rpcv2.h>
-#include <nfs/nfsproto.h>
-#include <nfs/nfs.h>
-#include <nfs/nfsdiskless.h>
 #include <nfs/krpc.h>
 #include <nfs/xdr_subs.h>
-#include <nfs/nfs_var.h>
+
+#include <nfs/nfsproto.h>
+#include <nfs/nfsdiskless.h>
 
 #include "arp.h"
 #if NARP == 0
@@ -82,13 +80,6 @@
 	return (ENXIO);
 }
 
-int
-nfs_boot_getfh(ndm)
-	struct nfs_dlmount *ndm;
-{
-	return (ENXIO);
-}
-
 #else /* NARP */
 
 /*
@@ -109,6 +100,7 @@
 	struct nfs_args *argp));
 
 static void nfs_boot_defrt __P((struct in_addr *));
+static  int nfs_boot_getfh __P((struct nfs_dlmount *ndm));
 
 
 /*
@@ -155,7 +147,25 @@
 	if (nd->nd_gwip.s_addr)
 		nfs_boot_defrt(&nd->nd_gwip);
 
-	return (0);
+	/*
+	 * Now fetch the NFS file handles as appropriate.
+	 */
+	error = nfs_boot_getfh(&nd->nd_root);
+	if (error)
+		return (error);
+
+#if 0	/* swap now comes in from swapctl(2) */
+	if (nd->nd_swap.ndm_saddr.sa_len) {
+		error = nfs_boot_getfh(&nd->nd_swap);
+		if (error) {
+			printf("nfs_boot: warning: getfh(swap), error=%d\n", error);
+			/* Just ignore the error */
+			error = 0;
+		}
+	}
+#endif
+
+	return (error);
 }
 
 /*
@@ -197,7 +207,7 @@
  * Separate function because we used to call it twice.
  * (once for root and once for swap)
  */
-int
+static int
 nfs_boot_getfh(ndm)
 	struct nfs_dlmount *ndm;	/* output */
 {
--- a/sys/nfs/nfs_vfsops.c	Tue Sep 09 21:36:35 1997 +0000
+++ b/sys/nfs/nfs_vfsops.c	Tue Sep 09 21:39:17 1997 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_vfsops.c,v 1.63 1997/08/29 16:12:51 gwr Exp $	*/
+/*	$NetBSD: nfs_vfsops.c,v 1.64 1997/09/09 21:39:19 gwr Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -301,9 +301,6 @@
 	/*
 	 * Create the root mount point.
 	 */
-	error = nfs_boot_getfh(&nd->nd_root);
-	if (error)
-		goto out;
 	error = nfs_mount_diskless(&nd->nd_root, "/", &mp, &vp);
 	if (error)
 		goto out;
@@ -373,12 +370,6 @@
 	 * Create a fake mount point just for the swap vnode so that the
 	 * swap file can be on a different server from the rootfs.
 	 */
-	error = nfs_boot_getfh(&nd->nd_swap);
-	if (error) {
-		printf("nfs_boot: warning: getfh(swap), error=%d\n", error);
-		error = 0;
-		goto out;
-	}
 	error = nfs_mount_diskless(&nd->nd_swap, "/swap", &mp, &vp);
 	if (error) {
 		printf("nfs_boot: warning: mount(swap), error=%d\n", error);
--- a/sys/nfs/nfsdiskless.h	Tue Sep 09 21:36:35 1997 +0000
+++ b/sys/nfs/nfsdiskless.h	Tue Sep 09 21:39:17 1997 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsdiskless.h,v 1.13 1997/08/29 16:12:52 gwr Exp $	*/
+/*	$NetBSD: nfsdiskless.h,v 1.14 1997/09/09 21:39:20 gwr Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -67,7 +67,6 @@
 };
 
 int nfs_boot_init __P((struct nfs_diskless *nd, struct proc *procp));
-int nfs_boot_getfh __P((struct nfs_dlmount *ndm));
 
 int nfs_bootdhcp  __P((struct ifnet *, struct nfs_diskless *, struct proc *));
 int nfs_bootparam __P((struct ifnet *, struct nfs_diskless *, struct proc *));