diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-03-31 13:16:48 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-03-31 13:16:48 +0000 |
commit | 21504931d6eeb371924b7751ab95d7209ef959db (patch) | |
tree | d80b42388119345065cd25ccf71050a3ed63ae26 /sys/nfs/nfs_boot.c | |
parent | 633344117da42400851635ede8dd4464fb125ae7 (diff) |
From NetBSD: NFSv3 import (tomorrow's Net's kernel)
Open's patches kept in. i'll possibly take a look at Lite2 soon,
is there smth usefull ?..
Diffstat (limited to 'sys/nfs/nfs_boot.c')
-rw-r--r-- | sys/nfs/nfs_boot.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c index 130743a21a1..3ad4e535ba8 100644 --- a/sys/nfs/nfs_boot.c +++ b/sys/nfs/nfs_boot.c @@ -1,5 +1,5 @@ -/* $OpenBSD: nfs_boot.c,v 1.3 1996/02/29 09:24:49 niklas Exp $ */ -/* $NetBSD: nfs_boot.c,v 1.23 1996/02/13 17:53:33 gwr Exp $ */ +/* $OpenBSD: nfs_boot.c,v 1.4 1996/03/31 13:15:34 mickey Exp $ */ +/* $NetBSD: nfs_boot.c,v 1.25 1996/02/18 11:53:41 fvdl Exp $ */ /* * Copyright (c) 1995 Adam Glass, Gordon Ross @@ -47,7 +47,7 @@ #include <netinet/if_ether.h> #include <nfs/rpcv2.h> -#include <nfs/nfsv2.h> +#include <nfs/nfsproto.h> #include <nfs/nfs.h> #include <nfs/nfsdiskless.h> #include <nfs/krpc.h> @@ -64,6 +64,15 @@ int nfs_boot_init(nd, procp) panic("nfs_boot_init: no ether"); } +void +nfs_boot_getfh(bpsin, key, ndmntp) + struct sockaddr_in *bpsin; + char *key; + struct nfs_dlmount *ndmntp; +{ + /* can not get here */ +} + #else /* NETHER */ /* @@ -96,10 +105,6 @@ static int bp_getfile __P((struct sockaddr_in *bpsin, char *key, static int md_mount __P((struct sockaddr_in *mdsin, char *path, u_char *fh)); -/* other helpers */ -static void get_path_and_handle __P((struct sockaddr_in *bpsin, - char *key, struct nfs_dlmount *ndmntp)); - char *nfsbootdevname; /* @@ -164,7 +169,7 @@ nfs_boot_init(nd, procp) */ if ((error = revarpwhoami(&my_ip, ifp)) != 0) panic("revarp failed, error=%d", error); - printf("nfs_boot: client_addr=0x%x\n", ntohl(my_ip.s_addr)); + printf("nfs_boot: client_addr=0x%x\n", (u_int32_t)ntohl(my_ip.s_addr)); /* * Do enough of ifconfig(8) so that the chosen interface @@ -200,7 +205,7 @@ nfs_boot_init(nd, procp) if (error) panic("nfs_boot: bootparam whoami, error=%d", error); printf("nfs_boot: server_addr=0x%x\n", - ntohl(bp_sin.sin_addr.s_addr)); + (u_int32_t)ntohl(bp_sin.sin_addr.s_addr)); printf("nfs_boot: hostname=%s\n", hostname); #ifdef NFS_BOOT_GATEWAY @@ -263,8 +268,7 @@ nfs_boot_getfh(bpsin, key, ndmntp) * Get server:pathname for "key" (root or swap) * using RPC to bootparam/getfile */ - error = bp_getfile(bpsin, key, sin, - ndmntp->ndm_host, pathname); + error = bp_getfile(bpsin, key, sin, ndmntp->ndm_host, pathname); if (error) panic("nfs_boot: bootparam get %s: %d", key, error); @@ -505,7 +509,7 @@ md_mount(mdsin, path, fhp) /* The RPC structures */ struct rdata { u_int32_t errno; - u_int8_t fh[NFS_FHSIZE]; + u_int8_t fh[NFSX_V2FH]; } *rdata; struct mbuf *m; int error; @@ -517,7 +521,7 @@ md_mount(mdsin, path, fhp) m = xdr_string_encode(path, strlen(path)); if (m == NULL) - return (ENOMEM); + return ENOMEM; /* Do RPC to mountd. */ error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER1, @@ -534,14 +538,14 @@ md_mount(mdsin, path, fhp) if (error) goto out; - /* Have errno==0, so the fh must be there. */ + /* Have errno==0, so the fh must be there. */ if (m->m_len < sizeof(*rdata)) { m = m_pullup(m, sizeof(*rdata)); if (m == NULL) goto bad; rdata = mtod(m, struct rdata *); } - bcopy(rdata->fh, fhp, NFS_FHSIZE); + bcopy(rdata->fh, fhp, NFSX_V2FH); goto out; bad: |