View | Details | Raw Unified | Return to bug 26324
Collapse All | Expand All

(-)/sys/nfs/nfs_vfsops.c (-6 / +33 lines)
Lines 841-847 Link Here
841
	register struct nfsmount *nmp;
841
	register struct nfsmount *nmp;
842
	struct nfsnode *np;
842
	struct nfsnode *np;
843
	int error;
843
	int error;
844
	struct vattr attrs;
845
844
846
	if (mp->mnt_flag & MNT_UPDATE) {
845
	if (mp->mnt_flag & MNT_UPDATE) {
847
		nmp = VFSTONFS(mp);
846
		nmp = VFSTONFS(mp);
Lines 883-890 Link Here
883
882
884
	nmp->nm_timeo = NFS_TIMEO;
883
	nmp->nm_timeo = NFS_TIMEO;
885
	nmp->nm_retry = NFS_RETRANS;
884
	nmp->nm_retry = NFS_RETRANS;
886
	nmp->nm_wsize = NFS_WSIZE;
885
	if (argp->flags & NFSMNT_NFSV3) {
887
	nmp->nm_rsize = NFS_RSIZE;
886
		if (argp->sotype == SOCK_STREAM) {
887
			nmp->nm_wsize = nmp->nm_rsize = NFS_MAXDATA;
888
		} else {
889
			nmp->nm_wsize = NFS_WSIZE;
890
			nmp->nm_rsize = NFS_RSIZE;
891
		}
892
	} else {
893
		nmp->nm_wsize = NFS_WSIZE;
894
		nmp->nm_rsize = NFS_RSIZE;
895
	}
888
	nmp->nm_readdirsize = NFS_READDIRSIZE;
896
	nmp->nm_readdirsize = NFS_READDIRSIZE;
889
	nmp->nm_numgrps = NFS_MAXGRPS;
897
	nmp->nm_numgrps = NFS_MAXGRPS;
890
	nmp->nm_readahead = NFS_DEFRAHEAD;
898
	nmp->nm_readahead = NFS_DEFRAHEAD;
Lines 932-941 Link Here
932
	*vpp = NFSTOV(np);
940
	*vpp = NFSTOV(np);
933
941
934
	/*
942
	/*
935
	 * Get file attributes for the mountpoint.  This has the side
943
	 * Retrieval of mountpoint attributes is delayed until nfs_root
936
	 * effect of filling in (*vpp)->v_type with the correct value.
944
	 * or nfs_statfs are first called. This will happen either when
945
	 * we first traverse the mount point or if somebody does a df.
946
	 *
947
	 * NFSSTA_GOTFSINFO is used to flag if we have succesfully
948
	 * retreived mountpoint attributes. In the case of NFSv3 we
949
	 * also flag static fsinfo.
937
	 */
950
	 */
938
	VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curproc);
951
	(*vpp)->v_type = VNON;
939
952
940
	/*
953
	/*
941
	 * Lose the lock but keep the ref.
954
	 * Lose the lock but keep the ref.
Lines 1042-1047 Link Here
1042
	if (error)
1055
	if (error)
1043
		return (error);
1056
		return (error);
1044
	vp = NFSTOV(np);
1057
	vp = NFSTOV(np);
1058
	/*
1059
	 * Get transfer parameters and root vnode attributes.
1060
	 */
1061
	if ((nmp->nm_state & NFSSTA_GOTFSINFO) == 0) {
1062
	    if (nmp->nm_flag & NFSMNT_NFSV3) {
1063
	        nfs_fsinfo(nmp, vp, curproc->p_ucred, curproc);
1064
		mp->mnt_stat.f_iosize = nfs_iosize(nmp);
1065
	    } else {
1066
	        struct vattr attrs;
1067
	        error = VOP_GETATTR(vp, &attrs, curproc->p_ucred, curproc);
1068
		if (!error)
1069
		    nmp->nm_state |= NFSSTA_GOTFSINFO;		  
1070
	  }
1071
	}
1045
	if (vp->v_type == VNON)
1072
	if (vp->v_type == VNON)
1046
	    vp->v_type = VDIR;
1073
	    vp->v_type = VDIR;
1047
	vp->v_flag = VROOT;
1074
	vp->v_flag = VROOT;

Return to bug 26324