Deleted Added
full compact
nfs_clvfsops.c (192145) nfs_clvfsops.c (192585)
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 192145 2009-05-15 16:03:11Z rmacklem $");
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 192585 2009-05-22 15:08:12Z 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>

--- 43 unchanged lines hidden (view full) ---

88static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY;
89SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_INITIAL_DELAY,
90 downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, "");
91/* how long between console messages "nfs server foo not responding" */
92static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
93SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY,
94 downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
95
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>

--- 43 unchanged lines hidden (view full) ---

88static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY;
89SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_INITIAL_DELAY,
90 downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, "");
91/* how long between console messages "nfs server foo not responding" */
92static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
93SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY,
94 downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
95
96static void nfs_sec_name(char *, int *);
96static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp,
97 struct nfs_args *argp, struct ucred *, struct thread *);
98static int mountnfs(struct nfs_args *, struct mount *,
99 struct sockaddr *, char *, u_char *, u_char *, u_char *,
100 struct vnode **, struct ucred *, struct thread *);
101static vfs_mount_t nfs_mount;
102static vfs_cmount_t nfs_cmount;
103static vfs_unmount_t nfs_unmount;

--- 399 unchanged lines hidden (view full) ---

503 td->td_ucred, td)) != 0) {
504 printf("nfs_mountroot: mount %s on /: %d\n", path, error);
505 return (error);
506 }
507 return (0);
508}
509
510static void
97static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp,
98 struct nfs_args *argp, struct ucred *, struct thread *);
99static int mountnfs(struct nfs_args *, struct mount *,
100 struct sockaddr *, char *, u_char *, u_char *, u_char *,
101 struct vnode **, struct ucred *, struct thread *);
102static vfs_mount_t nfs_mount;
103static vfs_cmount_t nfs_cmount;
104static vfs_unmount_t nfs_unmount;

--- 399 unchanged lines hidden (view full) ---

504 td->td_ucred, td)) != 0) {
505 printf("nfs_mountroot: mount %s on /: %d\n", path, error);
506 return (error);
507 }
508 return (0);
509}
510
511static void
512nfs_sec_name(char *sec, int *flagsp)
513{
514 if (!strcmp(sec, "krb5"))
515 *flagsp |= NFSMNT_KERB;
516 else if (!strcmp(sec, "krb5i"))
517 *flagsp |= (NFSMNT_KERB | NFSMNT_INTEGRITY);
518 else if (!strcmp(sec, "krb5p"))
519 *flagsp |= (NFSMNT_KERB | NFSMNT_PRIVACY);
520}
521
522static void
511nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
512 struct ucred *cred, struct thread *td)
513{
514 int s;
515 int adjsock;
516
517 s = splnet();
518

--- 128 unchanged lines hidden (view full) ---

647 }
648 }
649 } else {
650 nmp->nm_sotype = argp->sotype;
651 nmp->nm_soproto = argp->proto;
652 }
653}
654
523nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp,
524 struct ucred *cred, struct thread *td)
525{
526 int s;
527 int adjsock;
528
529 s = splnet();
530

--- 128 unchanged lines hidden (view full) ---

659 }
660 }
661 } else {
662 nmp->nm_sotype = argp->sotype;
663 nmp->nm_soproto = argp->proto;
664 }
665}
666
655static const char *nfs_opts[] = { "from", "nfs_args",
667static const char *nfs_opts[] = { "from",
656 "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
657 "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
668 "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
669 "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
658 "async", "dumbtimer", "noconn", "nolockd", "intr", "rdirplus", "resvport",
659 "readdirsize", "soft", "hard", "mntudp", "tcp", "wsize", "rsize",
660 "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax",
670 "async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus",
671 "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize",
672 "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport",
673 "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec",
674 "principal", "nfsv4", "gssname", "allgssname", "dirpath",
661 NULL };
662
663/*
664 * VFS Operations.
665 *
666 * mount system call
667 * It seems a bit dumb to copyinstr() the host and path here and then
668 * bcopy() them in mountnfs(), but I wanted to detect errors before

--- 23 unchanged lines hidden (view full) ---

692 .hostname = NULL,
693 /* args version 4 */
694 .acregmin = NFS_MINATTRTIMO,
695 .acregmax = NFS_MAXATTRTIMO,
696 .acdirmin = NFS_MINDIRATTRTIMO,
697 .acdirmax = NFS_MAXDIRATTRTIMO,
698 .dirlen = 0,
699 .krbnamelen = 0,
675 NULL };
676
677/*
678 * VFS Operations.
679 *
680 * mount system call
681 * It seems a bit dumb to copyinstr() the host and path here and then
682 * bcopy() them in mountnfs(), but I wanted to detect errors before

--- 23 unchanged lines hidden (view full) ---

706 .hostname = NULL,
707 /* args version 4 */
708 .acregmin = NFS_MINATTRTIMO,
709 .acregmax = NFS_MAXATTRTIMO,
710 .acdirmin = NFS_MINDIRATTRTIMO,
711 .acdirmax = NFS_MAXDIRATTRTIMO,
712 .dirlen = 0,
713 .krbnamelen = 0,
714 .srvkrbnamelen = 0,
700 };
715 };
701 int error;
702 struct sockaddr *nam;
716 int error = 0, ret, len;
717 struct sockaddr *nam = NULL;
703 struct vnode *vp;
704 struct thread *td;
705 char hst[MNAMELEN];
718 struct vnode *vp;
719 struct thread *td;
720 char hst[MNAMELEN];
706 size_t len;
707 u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
721 u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
722 char *opt, *name, *secname;
708
709 if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
710 error = EINVAL;
711 goto out;
712 }
713
714 td = curthread;
715 if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) {
716 error = ncl_mountroot(mp);
717 goto out;
718 }
719
723
724 if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
725 error = EINVAL;
726 goto out;
727 }
728
729 td = curthread;
730 if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) {
731 error = ncl_mountroot(mp);
732 goto out;
733 }
734
720 error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args, sizeof args);
721 if (error)
722 goto out;
735 nfscl_init();
723
736
724 if (args.version != NFS_ARGSVERSION) {
725 error = EPROGMISMATCH;
726 goto out;
737 /* Handle the new style options. */
738 if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0)
739 args.flags |= NFSMNT_NOCONN;
740 if (vfs_getopt(mp->mnt_optnew, "conn", NULL, NULL) == 0)
741 args.flags |= NFSMNT_NOCONN;
742 if (vfs_getopt(mp->mnt_optnew, "nolockd", NULL, NULL) == 0)
743 args.flags |= NFSMNT_NOLOCKD;
744 if (vfs_getopt(mp->mnt_optnew, "lockd", NULL, NULL) == 0)
745 args.flags &= ~NFSMNT_NOLOCKD;
746 if (vfs_getopt(mp->mnt_optnew, "intr", NULL, NULL) == 0)
747 args.flags |= NFSMNT_INT;
748 if (vfs_getopt(mp->mnt_optnew, "rdirplus", NULL, NULL) == 0)
749 args.flags |= NFSMNT_RDIRPLUS;
750 if (vfs_getopt(mp->mnt_optnew, "resvport", NULL, NULL) == 0)
751 args.flags |= NFSMNT_RESVPORT;
752 if (vfs_getopt(mp->mnt_optnew, "noresvport", NULL, NULL) == 0)
753 args.flags &= ~NFSMNT_RESVPORT;
754 if (vfs_getopt(mp->mnt_optnew, "soft", NULL, NULL) == 0)
755 args.flags |= NFSMNT_SOFT;
756 if (vfs_getopt(mp->mnt_optnew, "hard", NULL, NULL) == 0)
757 args.flags &= ~NFSMNT_SOFT;
758 if (vfs_getopt(mp->mnt_optnew, "mntudp", NULL, NULL) == 0)
759 args.sotype = SOCK_DGRAM;
760 if (vfs_getopt(mp->mnt_optnew, "udp", NULL, NULL) == 0)
761 args.sotype = SOCK_DGRAM;
762 if (vfs_getopt(mp->mnt_optnew, "tcp", NULL, NULL) == 0)
763 args.sotype = SOCK_STREAM;
764 if (vfs_getopt(mp->mnt_optnew, "nfsv3", NULL, NULL) == 0)
765 args.flags |= NFSMNT_NFSV3;
766 if (vfs_getopt(mp->mnt_optnew, "nfsv4", NULL, NULL) == 0) {
767 args.flags |= NFSMNT_NFSV4;
768 args.sotype = SOCK_STREAM;
727 }
769 }
770 if (vfs_getopt(mp->mnt_optnew, "allgssname", NULL, NULL) == 0)
771 args.flags |= NFSMNT_ALLGSSNAME;
772 if (vfs_getopt(mp->mnt_optnew, "readdirsize", (void **)&opt, NULL) == 0) {
773 if (opt == NULL) {
774 vfs_mount_error(mp, "illegal readdirsize");
775 error = EINVAL;
776 goto out;
777 }
778 ret = sscanf(opt, "%d", &args.readdirsize);
779 if (ret != 1 || args.readdirsize <= 0) {
780 vfs_mount_error(mp, "illegal readdirsize: %s",
781 opt);
782 error = EINVAL;
783 goto out;
784 }
785 args.flags |= NFSMNT_READDIRSIZE;
786 }
787 if (vfs_getopt(mp->mnt_optnew, "readahead", (void **)&opt, NULL) == 0) {
788 if (opt == NULL) {
789 vfs_mount_error(mp, "illegal readahead");
790 error = EINVAL;
791 goto out;
792 }
793 ret = sscanf(opt, "%d", &args.readahead);
794 if (ret != 1 || args.readahead <= 0) {
795 vfs_mount_error(mp, "illegal readahead: %s",
796 opt);
797 error = EINVAL;
798 goto out;
799 }
800 args.flags |= NFSMNT_READAHEAD;
801 }
802 if (vfs_getopt(mp->mnt_optnew, "wsize", (void **)&opt, NULL) == 0) {
803 if (opt == NULL) {
804 vfs_mount_error(mp, "illegal wsize");
805 error = EINVAL;
806 goto out;
807 }
808 ret = sscanf(opt, "%d", &args.wsize);
809 if (ret != 1 || args.wsize <= 0) {
810 vfs_mount_error(mp, "illegal wsize: %s",
811 opt);
812 error = EINVAL;
813 goto out;
814 }
815 args.flags |= NFSMNT_WSIZE;
816 }
817 if (vfs_getopt(mp->mnt_optnew, "rsize", (void **)&opt, NULL) == 0) {
818 if (opt == NULL) {
819 vfs_mount_error(mp, "illegal rsize");
820 error = EINVAL;
821 goto out;
822 }
823 ret = sscanf(opt, "%d", &args.rsize);
824 if (ret != 1 || args.rsize <= 0) {
825 vfs_mount_error(mp, "illegal wsize: %s",
826 opt);
827 error = EINVAL;
828 goto out;
829 }
830 args.flags |= NFSMNT_RSIZE;
831 }
832 if (vfs_getopt(mp->mnt_optnew, "retrans", (void **)&opt, NULL) == 0) {
833 if (opt == NULL) {
834 vfs_mount_error(mp, "illegal retrans");
835 error = EINVAL;
836 goto out;
837 }
838 ret = sscanf(opt, "%d", &args.retrans);
839 if (ret != 1 || args.retrans <= 0) {
840 vfs_mount_error(mp, "illegal retrans: %s",
841 opt);
842 error = EINVAL;
843 goto out;
844 }
845 args.flags |= NFSMNT_RETRANS;
846 }
847 if (vfs_getopt(mp->mnt_optnew, "acregmin", (void **)&opt, NULL) == 0) {
848 ret = sscanf(opt, "%d", &args.acregmin);
849 if (ret != 1 || args.acregmin < 0) {
850 vfs_mount_error(mp, "illegal acregmin: %s",
851 opt);
852 error = EINVAL;
853 goto out;
854 }
855 args.flags |= NFSMNT_ACREGMIN;
856 }
857 if (vfs_getopt(mp->mnt_optnew, "acregmax", (void **)&opt, NULL) == 0) {
858 ret = sscanf(opt, "%d", &args.acregmax);
859 if (ret != 1 || args.acregmax < 0) {
860 vfs_mount_error(mp, "illegal acregmax: %s",
861 opt);
862 error = EINVAL;
863 goto out;
864 }
865 args.flags |= NFSMNT_ACREGMAX;
866 }
867 if (vfs_getopt(mp->mnt_optnew, "acdirmin", (void **)&opt, NULL) == 0) {
868 ret = sscanf(opt, "%d", &args.acdirmin);
869 if (ret != 1 || args.acdirmin < 0) {
870 vfs_mount_error(mp, "illegal acdirmin: %s",
871 opt);
872 error = EINVAL;
873 goto out;
874 }
875 args.flags |= NFSMNT_ACDIRMIN;
876 }
877 if (vfs_getopt(mp->mnt_optnew, "acdirmax", (void **)&opt, NULL) == 0) {
878 ret = sscanf(opt, "%d", &args.acdirmax);
879 if (ret != 1 || args.acdirmax < 0) {
880 vfs_mount_error(mp, "illegal acdirmax: %s",
881 opt);
882 error = EINVAL;
883 goto out;
884 }
885 args.flags |= NFSMNT_ACDIRMAX;
886 }
887 if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) {
888 ret = sscanf(opt, "%d", &args.timeo);
889 if (ret != 1 || args.timeo <= 0) {
890 vfs_mount_error(mp, "illegal timeout: %s",
891 opt);
892 error = EINVAL;
893 goto out;
894 }
895 args.flags |= NFSMNT_TIMEO;
896 }
897 if (vfs_getopt(mp->mnt_optnew, "sec",
898 (void **) &secname, NULL) == 0)
899 nfs_sec_name(secname, &args.flags);
728
900
729 nfscl_init();
730
731 if (mp->mnt_flag & MNT_UPDATE) {
732 struct nfsmount *nmp = VFSTONFS(mp);
733
734 if (nmp == NULL) {
735 error = EIO;
736 goto out;
737 }
738 /*

--- 25 unchanged lines hidden (view full) ---

764 * no-connection mode (the flag will be cleared later for protocols
765 * that do not support no-connection mode). This will allow a client
766 * to receive replies from a different IP then the request was
767 * sent to. Note: default value for nfs_ip_paranoia is 1 (paranoid),
768 * not 0.
769 */
770 if (nfs_ip_paranoia == 0)
771 args.flags |= NFSMNT_NOCONN;
901 if (mp->mnt_flag & MNT_UPDATE) {
902 struct nfsmount *nmp = VFSTONFS(mp);
903
904 if (nmp == NULL) {
905 error = EIO;
906 goto out;
907 }
908 /*

--- 25 unchanged lines hidden (view full) ---

934 * no-connection mode (the flag will be cleared later for protocols
935 * that do not support no-connection mode). This will allow a client
936 * to receive replies from a different IP then the request was
937 * sent to. Note: default value for nfs_ip_paranoia is 1 (paranoid),
938 * not 0.
939 */
940 if (nfs_ip_paranoia == 0)
941 args.flags |= NFSMNT_NOCONN;
772 if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) {
773 error = EINVAL;
774 goto out;
775 }
776 if (args.fhsize > 0) {
777 error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
778 if (error)
779 goto out;
780 }
781 error = copyinstr(args.hostname, hst, MNAMELEN-1, &len);
782 if (error)
783 goto out;
784 bzero(&hst[len], MNAMELEN - len);
785 if (args.krbnamelen > 0) {
786 if (args.krbnamelen >= 100) {
942
943 if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh,
944 &args.fhsize) == 0) {
945 if (args.fhsize > NFSX_FHMAX) {
946 vfs_mount_error(mp, "Bad file handle");
787 error = EINVAL;
788 goto out;
789 }
947 error = EINVAL;
948 goto out;
949 }
790 error = copyin(args.krbname, krbname, args.krbnamelen);
791 if (error)
792 goto out;
793 krbname[args.krbnamelen] = '\0';
950 bcopy(args.fh, nfh, args.fhsize);
794 } else {
951 } else {
795 krbname[0] = '\0';
796 args.krbnamelen = 0;
952 args.fhsize = 0;
797 }
953 }
798 if (args.dirlen > 0) {
799 if (args.dirlen >= 100) {
800 error = EINVAL;
801 goto out;
802 }
803 error = copyin(args.dirpath, dirpath, args.dirlen);
804 if (error)
805 goto out;
806 dirpath[args.dirlen] = '\0';
807 } else {
808 dirpath[0] = '\0';
809 args.dirlen = 0;
954
955 (void) vfs_getopt(mp->mnt_optnew, "hostname", (void **)&args.hostname,
956 &len);
957 if (args.hostname == NULL) {
958 vfs_mount_error(mp, "Invalid hostname");
959 error = EINVAL;
960 goto out;
810 }
961 }
811 if (args.srvkrbnamelen > 0) {
812 if (args.srvkrbnamelen >= 100) {
813 error = EINVAL;
962 bcopy(args.hostname, hst, MNAMELEN);
963 hst[MNAMELEN - 1] = '\0';
964
965 if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0)
966 strlcpy(srvkrbname, name, sizeof (srvkrbname));
967 else
968 snprintf(srvkrbname, sizeof (srvkrbname), "nfs@%s", hst);
969 args.srvkrbnamelen = strlen(srvkrbname);
970
971 if (vfs_getopt(mp->mnt_optnew, "gssname", (void **)&name, NULL) == 0)
972 strlcpy(krbname, name, sizeof (krbname));
973 else
974 krbname[0] = '\0';
975 args.krbnamelen = strlen(krbname);
976
977 if (vfs_getopt(mp->mnt_optnew, "dirpath", (void **)&name, NULL) == 0)
978 strlcpy(dirpath, name, sizeof (dirpath));
979 else
980 dirpath[0] = '\0';
981 args.dirlen = strlen(dirpath);
982
983 if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr,
984 &args.addrlen) == 0) {
985 if (args.addrlen > SOCK_MAXADDRLEN) {
986 error = ENAMETOOLONG;
814 goto out;
815 }
987 goto out;
988 }
816 error = copyin(args.srvkrbname, srvkrbname, args.srvkrbnamelen);
817 if (error)
818 goto out;
819 srvkrbname[args.srvkrbnamelen] = '\0';
820 } else {
821 srvkrbname[0] = '\0';
822 args.srvkrbnamelen = 0;
989 nam = malloc(args.addrlen, M_SONAME, M_WAITOK);
990 bcopy(args.addr, nam, args.addrlen);
991 nam->sa_len = args.addrlen;
823 }
992 }
824 /* sockargs() call must be after above copyin() calls */
825 error = getsockaddr(&nam, (caddr_t)args.addr, args.addrlen);
826 if (error)
827 goto out;
993
828 args.fh = nfh;
829 error = mountnfs(&args, mp, nam, hst, krbname, dirpath, srvkrbname,
830 &vp, td->td_ucred, td);
831out:
832 if (!error) {
833 MNT_ILOCK(mp);
834 mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED);
835 MNT_IUNLOCK(mp);

--- 98 unchanged lines hidden (view full) ---

934 nmp->nm_sockreq.nr_cred = crhold(cred);
935 mtx_init(&nmp->nm_sockreq.nr_mtx, "nfssock", NULL, MTX_DEF);
936 mp->mnt_data = nmp;
937 }
938 vfs_getnewfsid(mp);
939 nmp->nm_mountp = mp;
940 mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK);
941
994 args.fh = nfh;
995 error = mountnfs(&args, mp, nam, hst, krbname, dirpath, srvkrbname,
996 &vp, td->td_ucred, td);
997out:
998 if (!error) {
999 MNT_ILOCK(mp);
1000 mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED);
1001 MNT_IUNLOCK(mp);

--- 98 unchanged lines hidden (view full) ---

1100 nmp->nm_sockreq.nr_cred = crhold(cred);
1101 mtx_init(&nmp->nm_sockreq.nr_mtx, "nfssock", NULL, MTX_DEF);
1102 mp->mnt_data = nmp;
1103 }
1104 vfs_getnewfsid(mp);
1105 nmp->nm_mountp = mp;
1106 mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK);
1107
1108 nfs_decode_args(mp, nmp, argp, cred, td);
1109
942 /*
943 * V2 can only handle 32 bit filesizes. A 4GB-1 limit may be too
944 * high, depending on whether we end up with negative offsets in
945 * the client or server somewhere. 2GB-1 may be safer.
946 *
947 * For V3, ncl_fsinfo will adjust this as necessary. Assume maximum
948 * that we can handle until we find out otherwise.
949 * XXX Our "safe" limit on the client is what we can store in our

--- 31 unchanged lines hidden (view full) ---

981 nmp->nm_sockreq.nr_prog = NFS_PROG;
982 if ((argp->flags & NFSMNT_NFSV4))
983 nmp->nm_sockreq.nr_vers = NFS_VER4;
984 else if ((argp->flags & NFSMNT_NFSV3))
985 nmp->nm_sockreq.nr_vers = NFS_VER3;
986 else
987 nmp->nm_sockreq.nr_vers = NFS_VER2;
988
1110 /*
1111 * V2 can only handle 32 bit filesizes. A 4GB-1 limit may be too
1112 * high, depending on whether we end up with negative offsets in
1113 * the client or server somewhere. 2GB-1 may be safer.
1114 *
1115 * For V3, ncl_fsinfo will adjust this as necessary. Assume maximum
1116 * that we can handle until we find out otherwise.
1117 * XXX Our "safe" limit on the client is what we can store in our

--- 31 unchanged lines hidden (view full) ---

1149 nmp->nm_sockreq.nr_prog = NFS_PROG;
1150 if ((argp->flags & NFSMNT_NFSV4))
1151 nmp->nm_sockreq.nr_vers = NFS_VER4;
1152 else if ((argp->flags & NFSMNT_NFSV3))
1153 nmp->nm_sockreq.nr_vers = NFS_VER3;
1154 else
1155 nmp->nm_sockreq.nr_vers = NFS_VER2;
1156
989 nfs_decode_args(mp, nmp, argp, cred, td);
990
991 /*
992 * For Connection based sockets (TCP,...) do the connect here,
993 * but make it interruptible, even for non-interuptible mounts.
994 */
995 if ((nmp->nm_flag & NFSMNT_INT) == 0) {
996 nmp->nm_flag |= NFSMNT_INT;
997 clearintr = 1;

--- 280 unchanged lines hidden ---
1157
1158 /*
1159 * For Connection based sockets (TCP,...) do the connect here,
1160 * but make it interruptible, even for non-interuptible mounts.
1161 */
1162 if ((nmp->nm_flag & NFSMNT_INT) == 0) {
1163 nmp->nm_flag |= NFSMNT_INT;
1164 clearintr = 1;

--- 280 unchanged lines hidden ---