nfs_clvfsops.c (194118) | nfs_clvfsops.c (195762) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_vfsops.c 8.12 (Berkeley) 5/20/95 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_vfsops.c 8.12 (Berkeley) 5/20/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 194118 2009-06-13 15:39:12Z jamie $"); | 36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 195762 2009-07-19 16:44:26Z rmacklem $"); |
37 38 39#include "opt_bootp.h" 40#include "opt_nfsroot.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> --- 987 unchanged lines hidden (view full) --- 1032 */ 1033static int 1034mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, 1035 char *hst, u_char *krbname, u_char *dirpath, u_char *srvkrbname, 1036 struct vnode **vpp, struct ucred *cred, struct thread *td) 1037{ 1038 struct nfsmount *nmp; 1039 struct nfsnode *np; | 37 38 39#include "opt_bootp.h" 40#include "opt_nfsroot.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> --- 987 unchanged lines hidden (view full) --- 1032 */ 1033static int 1034mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, 1035 char *hst, u_char *krbname, u_char *dirpath, u_char *srvkrbname, 1036 struct vnode **vpp, struct ucred *cred, struct thread *td) 1037{ 1038 struct nfsmount *nmp; 1039 struct nfsnode *np; |
1040 int error, trycnt, ret, clearintr; | 1040 int error, trycnt, ret; |
1041 struct nfsvattr nfsva; 1042 static u_int64_t clval = 0; 1043 1044 if (mp->mnt_flag & MNT_UPDATE) { 1045 nmp = VFSTONFS(mp); 1046 printf("%s: MNT_UPDATE is no longer handled here\n", __func__); 1047 FREE(nam, M_SONAME); 1048 return (0); --- 98 unchanged lines hidden (view full) --- 1147 if ((argp->flags & NFSMNT_NFSV4)) 1148 nmp->nm_sockreq.nr_vers = NFS_VER4; 1149 else if ((argp->flags & NFSMNT_NFSV3)) 1150 nmp->nm_sockreq.nr_vers = NFS_VER3; 1151 else 1152 nmp->nm_sockreq.nr_vers = NFS_VER2; 1153 1154 | 1041 struct nfsvattr nfsva; 1042 static u_int64_t clval = 0; 1043 1044 if (mp->mnt_flag & MNT_UPDATE) { 1045 nmp = VFSTONFS(mp); 1046 printf("%s: MNT_UPDATE is no longer handled here\n", __func__); 1047 FREE(nam, M_SONAME); 1048 return (0); --- 98 unchanged lines hidden (view full) --- 1147 if ((argp->flags & NFSMNT_NFSV4)) 1148 nmp->nm_sockreq.nr_vers = NFS_VER4; 1149 else if ((argp->flags & NFSMNT_NFSV3)) 1150 nmp->nm_sockreq.nr_vers = NFS_VER3; 1151 else 1152 nmp->nm_sockreq.nr_vers = NFS_VER2; 1153 1154 |
1155 /* 1156 * For Connection based sockets (TCP,...) do the connect here, 1157 * but make it interruptible, even for non-interuptible mounts. 1158 */ 1159 if ((nmp->nm_flag & NFSMNT_INT) == 0) { 1160 nmp->nm_flag |= NFSMNT_INT; 1161 clearintr = 1; 1162 } else { 1163 clearintr = 0; 1164 } | |
1165 if ((error = newnfs_connect(nmp, &nmp->nm_sockreq, cred, td, 0))) 1166 goto bad; | 1155 if ((error = newnfs_connect(nmp, &nmp->nm_sockreq, cred, td, 0))) 1156 goto bad; |
1167 if (clearintr) 1168 nmp->nm_flag &= ~NFSMNT_INT; | |
1169 1170 /* 1171 * A reference count is needed on the nfsnode representing the 1172 * remote root. If this object is not persistent, then backward 1173 * traversals of the mount point (i.e. "..") will not work if 1174 * the nfsnode gets flushed out of the cache. Ufs does not have 1175 * this problem, because one can identify root inodes by their 1176 * number == ROOTINO (2). --- 12 unchanged lines hidden (view full) --- 1189 (void) nfs_catnap(PZERO, "nfsgetdirp"); 1190 } while (error && --trycnt > 0); 1191 if (error) { 1192 error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); 1193 goto bad; 1194 } 1195 } 1196 if (nmp->nm_fhsize > 0) { | 1157 1158 /* 1159 * A reference count is needed on the nfsnode representing the 1160 * remote root. If this object is not persistent, then backward 1161 * traversals of the mount point (i.e. "..") will not work if 1162 * the nfsnode gets flushed out of the cache. Ufs does not have 1163 * this problem, because one can identify root inodes by their 1164 * number == ROOTINO (2). --- 12 unchanged lines hidden (view full) --- 1177 (void) nfs_catnap(PZERO, "nfsgetdirp"); 1178 } while (error && --trycnt > 0); 1179 if (error) { 1180 error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); 1181 goto bad; 1182 } 1183 } 1184 if (nmp->nm_fhsize > 0) { |
1185 /* 1186 * Set f_iosize to NFS_DIRBLKSIZ so that bo_bsize gets set 1187 * non-zero for the root vnode. f_iosize will be set correctly 1188 * by nfs_statfs() before any I/O occurs. 1189 */ 1190 mp->mnt_stat.f_iosize = NFS_DIRBLKSIZ; |
|
1197 error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np); 1198 if (error) 1199 goto bad; 1200 *vpp = NFSTOV(np); 1201 1202 /* 1203 * Get file attributes and transfer parameters for the 1204 * mountpoint. This has the side effect of filling in --- 237 unchanged lines hidden --- | 1191 error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np); 1192 if (error) 1193 goto bad; 1194 *vpp = NFSTOV(np); 1195 1196 /* 1197 * Get file attributes and transfer parameters for the 1198 * mountpoint. This has the side effect of filling in --- 237 unchanged lines hidden --- |