Deleted Added
full compact
nfs_vfsops.c (91406) nfs_vfsops.c (92783)
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

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
37 */
38
39#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

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
37 */
38
39#include <sys/cdefs.h>
40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_vfsops.c 91406 2002-02-27 18:32:23Z jhb $");
40__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_vfsops.c 92783 2002-03-20 10:07:52Z jeff $");
41
42#include "opt_bootp.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/malloc.h>

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

53#include <sys/socket.h>
54#include <sys/socketvar.h>
55#include <sys/sockio.h>
56#include <sys/sysctl.h>
57#include <sys/vnode.h>
58
59#include <vm/vm.h>
60#include <vm/vm_extern.h>
41
42#include "opt_bootp.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/malloc.h>

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

53#include <sys/socket.h>
54#include <sys/socketvar.h>
55#include <sys/sockio.h>
56#include <sys/sysctl.h>
57#include <sys/vnode.h>
58
59#include <vm/vm.h>
60#include <vm/vm_extern.h>
61#include <vm/vm_zone.h>
61#include <vm/uma.h>
62
63#include <net/if.h>
64#include <net/route.h>
65#include <netinet/in.h>
66
67#include <nfs/rpcv2.h>
68#include <nfs/nfsproto.h>
69#include <nfsclient/nfs.h>
70#include <nfsclient/nfsnode.h>
71#include <nfsclient/nfsmount.h>
72#include <nfs/xdr_subs.h>
73#include <nfsclient/nfsm_subs.h>
74#include <nfsclient/nfsdiskless.h>
75
76MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header");
77MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle");
78MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data");
79MALLOC_DEFINE(M_NFSHASH, "NFS hash", "NFS hash tables");
80
62
63#include <net/if.h>
64#include <net/route.h>
65#include <netinet/in.h>
66
67#include <nfs/rpcv2.h>
68#include <nfs/nfsproto.h>
69#include <nfsclient/nfs.h>
70#include <nfsclient/nfsnode.h>
71#include <nfsclient/nfsmount.h>
72#include <nfs/xdr_subs.h>
73#include <nfsclient/nfsm_subs.h>
74#include <nfsclient/nfsdiskless.h>
75
76MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header");
77MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle");
78MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data");
79MALLOC_DEFINE(M_NFSHASH, "NFS hash", "NFS hash tables");
80
81vm_zone_t nfsmount_zone;
81uma_zone_t nfsmount_zone;
82
83struct nfsstats nfsstats;
84SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem");
85SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RD,
86 &nfsstats, nfsstats, "S,nfsstats");
87#ifdef NFS_DEBUG
88int nfs_debug;
89SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, "");

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

804 struct vattr attrs;
805
806 if (mp->mnt_flag & MNT_UPDATE) {
807 nmp = VFSTONFS(mp);
808 /* update paths, file handles, etc, here XXX */
809 FREE(nam, M_SONAME);
810 return (0);
811 } else {
82
83struct nfsstats nfsstats;
84SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem");
85SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RD,
86 &nfsstats, nfsstats, "S,nfsstats");
87#ifdef NFS_DEBUG
88int nfs_debug;
89SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, "");

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

804 struct vattr attrs;
805
806 if (mp->mnt_flag & MNT_UPDATE) {
807 nmp = VFSTONFS(mp);
808 /* update paths, file handles, etc, here XXX */
809 FREE(nam, M_SONAME);
810 return (0);
811 } else {
812 nmp = zalloc(nfsmount_zone);
812 nmp = uma_zalloc(nfsmount_zone, M_WAITOK);
813 bzero((caddr_t)nmp, sizeof (struct nfsmount));
814 TAILQ_INIT(&nmp->nm_bufq);
815 mp->mnt_data = (qaddr_t)nmp;
816 }
817 vfs_getnewfsid(mp);
818 nmp->nm_mountp = mp;
819 nmp->nm_cred = crhold(cred);
820

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

890 * Lose the lock but keep the ref.
891 */
892 VOP_UNLOCK(*vpp, 0, curthread);
893
894 return (0);
895bad:
896 nfs_disconnect(nmp);
897 crfree(nmp->nm_cred);
813 bzero((caddr_t)nmp, sizeof (struct nfsmount));
814 TAILQ_INIT(&nmp->nm_bufq);
815 mp->mnt_data = (qaddr_t)nmp;
816 }
817 vfs_getnewfsid(mp);
818 nmp->nm_mountp = mp;
819 nmp->nm_cred = crhold(cred);
820

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

890 * Lose the lock but keep the ref.
891 */
892 VOP_UNLOCK(*vpp, 0, curthread);
893
894 return (0);
895bad:
896 nfs_disconnect(nmp);
897 crfree(nmp->nm_cred);
898 zfree(nfsmount_zone, nmp);
898 uma_zfree(nfsmount_zone, nmp);
899 FREE(nam, M_SONAME);
900 return (error);
901}
902
903/*
904 * unmount system call
905 */
906static int

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

931
932 /*
933 * We are now committed to the unmount.
934 */
935 nfs_disconnect(nmp);
936 FREE(nmp->nm_nam, M_SONAME);
937
938 crfree(nmp->nm_cred);
899 FREE(nam, M_SONAME);
900 return (error);
901}
902
903/*
904 * unmount system call
905 */
906static int

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

931
932 /*
933 * We are now committed to the unmount.
934 */
935 nfs_disconnect(nmp);
936 FREE(nmp->nm_nam, M_SONAME);
937
938 crfree(nmp->nm_cred);
939 zfree(nfsmount_zone, nmp);
939 uma_zfree(nfsmount_zone, nmp);
940 return (0);
941}
942
943/*
944 * Return root of a filesystem
945 */
946static int
947nfs_root(struct mount *mp, struct vnode **vpp)

--- 64 unchanged lines hidden ---
940 return (0);
941}
942
943/*
944 * Return root of a filesystem
945 */
946static int
947nfs_root(struct mount *mp, struct vnode **vpp)

--- 64 unchanged lines hidden ---