Convert GIANT_REQUIRED; in nfs_mountroot() to NET_ASSERT_GIANT(),

and annotate that nfs_mountroot assumes it is OK to step on the
values in the global NFSv3 diskless structure as the mountroot
function is called during a serialized part of the boot, before
any other NFS client activity occurs.

MFC after:	2 weeks
This commit is contained in:
Robert Watson 2004-12-05 22:53:17 +00:00
parent 6bfde9e63b
commit 8880ff1eba

View File

@ -378,6 +378,11 @@ nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred,
* - If nfs_diskless.mygateway is filled in, use that address as
* a default gateway.
* - build the rootfs mount point and call mountnfs() to do the rest.
*
* It is assumed to be safe to read, modify, and write the nfsv3_diskless
* structure, as well as other global NFS client variables here, as
* nfs_mountroot() will be called once in the boot before any other NFS
* client activity occurs.
*/
int
nfs_mountroot(struct mount *mp, struct thread *td)
@ -389,7 +394,7 @@ nfs_mountroot(struct mount *mp, struct thread *td)
u_long l;
char buf[128];
GIANT_REQUIRED; /* XXX until socket locking done */
NET_ASSERT_GIANT();
#if defined(BOOTP_NFSROOT) && defined(BOOTP)
bootpc_init(); /* use bootp to get nfs_diskless filled in */