ifctx->replylen,
TAG_ROOTOPTS);
if (p != NULL) {
- mountopts(&nd->root_args, p);
+ nfs_mountopts(&nd->root_args, p);
kprintf("rootopts %s ", p);
}
} else
TAG_SWAPOPTS);
if (p != NULL) {
/* swap mount options */
- mountopts(&nd->swap_args, p);
+ nfs_mountopts(&nd->swap_args, p);
kprintf("swapopts %s ", p);
}
#endif
}
- mountopts(&nd->root_args, NULL);
+ nfs_mountopts(&nd->root_args, NULL);
- mountopts(&nd->swap_args, NULL);
+ nfs_mountopts(&nd->swap_args, NULL);
for (ifctx = gctx->interfaces; ifctx != NULL; ifctx = ifctx->next)
if (bootpc_ifctx_isresolved(ifctx) != 0)
* did everything the kernel wanted us to do.
*/
while ((bio = TAILQ_FIRST(&nmp->nm_bioq)) != NULL) {
- if (nmp->nm_reqqlen >= NFS_MAXASYNCBIO)
+ if (nmp->nm_reqqlen > nfs_maxasyncbio)
break;
TAILQ_REMOVE(&nmp->nm_bioq, bio, bio_act);
vp = bio->bio_driver_info;
static int xdr_int_decode(struct mbuf **ptr, int *iptr);
void
-mountopts(struct nfs_args *args, char *p)
+nfs_mountopts(struct nfs_args *args, char *p)
{
char *tmp;
args->rsize = 8192;
args->wsize = 8192;
args->flags = NFSMNT_RSIZE | NFSMNT_WSIZE | NFSMNT_RESVPORT;
- args->sotype = SOCK_DGRAM;
+ args->sotype = SOCK_STREAM;
if (p == NULL)
return;
if ((tmp = (char *)substr(p, "rsize=")))
args->flags |= NFSMNT_SOFT;
if ((tmp = (char *)substr(p, "noconn")))
args->flags |= NFSMNT_NOCONN;
- if ((tmp = (char *)substr(p, "tcp")))
- args->sotype = SOCK_STREAM;
+ if ((tmp = (char *)substr(p, "udp")))
+ args->sotype = SOCK_DGRAM;
}
/*
int authcount;
int authver;
-#ifdef BOOTP_NFSV3
/* First try NFS v3 */
/* Get port number for MOUNTD. */
error = krpc_portmap(mdsin, RPCPROG_MNT, RPCMNT_VER3,
if (error == 0) {
args->flags |= NFSMNT_NFSV3;
} else {
-#endif
/* Fallback to NFS v2 */
/* Get port number for MOUNTD. */
RPCMNT_MOUNT, &m, NULL, td);
if (error != 0)
return error; /* message already freed */
-
-#ifdef BOOTP_NFSV3
+ args->flags &= ~NFSMNT_NFSV3;
}
-#endif
if (xdr_int_decode(&m, &error) != 0 || error != 0)
goto bad;
rep->r_flags &= ~R_ONREQQ;
--nmp->nm_reqqlen;
if (TAILQ_FIRST(&nmp->nm_bioq) &&
- nmp->nm_reqqlen == NFS_MAXASYNCBIO * 2 / 3) {
+ nmp->nm_reqqlen <= nfs_maxasyncbio * 2 / 3) {
nfssvc_iod_writer_wakeup(nmp);
}
crit_exit();
rep->r_info->state = NFSM_STATE_PROCESSREPLY;
nfssvc_iod_reader_wakeup(nmp);
if (TAILQ_FIRST(&nmp->nm_bioq) &&
- nmp->nm_reqqlen == NFS_MAXASYNCBIO * 2 / 3) {
+ nmp->nm_reqqlen <= nfs_maxasyncbio * 2 / 3) {
nfssvc_iod_writer_wakeup(nmp);
}
}
#endif
/*
+ * Mainly for vkernel operation. If memory is severely limited
+ */
+ if (nfs_maxasyncbio > nmbclusters * MCLBYTES / NFS_MAXDATA / 3)
+ nfs_maxasyncbio = nmbclusters * MCLBYTES / NFS_MAXDATA / 3;
+ if (nfs_maxasyncbio < 4)
+ nfs_maxasyncbio = 4;
+
+ /*
* Initialize reply list and start timer
*/
nfs_timer(0);
u_char *fhp, int *fhsizep,
struct nfs_args *args,
struct thread *td);
-void mountopts(struct nfs_args *args, char *p);
+void nfs_mountopts(struct nfs_args *args, char *p);
int setfs(struct sockaddr_in *addr, char *path, char *p);
extern vm_offset_t virtual_end;
extern vm_paddr_t phys_avail[];
+/*
+ * Return true if the passed address is in the kernel address space.
+ * This is mainly a check that the address is NOT in the user address space.
+ *
+ * For a vkernels all addresses are in the kernel address space.
+ */
static inline int
kva_p(const void *addr)
{
- /* XXX: mapped? */
+#ifdef _KERNEL_VIRTUAL
+ return (addr != NULL);
+#else
return ((unsigned long)KvaStart <= (unsigned long)addr) &&
((unsigned long)addr < (unsigned long)KvaEnd);
+#endif
}
void pmap_change_wiring (pmap_t, vm_offset_t, boolean_t);