msdosfs_vfsops.c (5a5fccc8e792522375133484f4cebc9f7da2c7d3) msdosfs_vfsops.c (c24fda81c9fd87df7e4fe3a567cc0292078bc7bf)
1/* $FreeBSD$ */
2/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
3
4/*-
5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).

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

70
71MALLOC_DEFINE(M_MSDOSFSMNT, "MSDOSFS mount", "MSDOSFS mount structure");
72static MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table");
73
74static int update_mp __P((struct mount *mp, struct msdosfs_args *argp));
75static int mountmsdosfs __P((struct vnode *devvp, struct mount *mp,
76 struct proc *p, struct msdosfs_args *argp));
77static int msdosfs_fhtovp __P((struct mount *, struct fid *,
1/* $FreeBSD$ */
2/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
3
4/*-
5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).

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

70
71MALLOC_DEFINE(M_MSDOSFSMNT, "MSDOSFS mount", "MSDOSFS mount structure");
72static MALLOC_DEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOSFS file allocation table");
73
74static int update_mp __P((struct mount *mp, struct msdosfs_args *argp));
75static int mountmsdosfs __P((struct vnode *devvp, struct mount *mp,
76 struct proc *p, struct msdosfs_args *argp));
77static int msdosfs_fhtovp __P((struct mount *, struct fid *,
78 struct sockaddr *, struct vnode **, int *,
79 struct ucred **));
78 struct vnode **));
79static int msdosfs_checkexp __P((struct mount *, struct sockaddr *,
80 int *, struct ucred **));
80static int msdosfs_mount __P((struct mount *, char *, caddr_t,
81 struct nameidata *, struct proc *));
82static int msdosfs_root __P((struct mount *, struct vnode **));
83static int msdosfs_statfs __P((struct mount *, struct statfs *,
84 struct proc *));
85static int msdosfs_sync __P((struct mount *, int, struct ucred *,
86 struct proc *));
87static int msdosfs_unmount __P((struct mount *, int, struct proc *));

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

910 if (error)
911 allerror = error;
912 VOP_UNLOCK(pmp->pm_devvp, 0, p);
913 }
914 return (allerror);
915}
916
917static int
81static int msdosfs_mount __P((struct mount *, char *, caddr_t,
82 struct nameidata *, struct proc *));
83static int msdosfs_root __P((struct mount *, struct vnode **));
84static int msdosfs_statfs __P((struct mount *, struct statfs *,
85 struct proc *));
86static int msdosfs_sync __P((struct mount *, int, struct ucred *,
87 struct proc *));
88static int msdosfs_unmount __P((struct mount *, int, struct proc *));

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

911 if (error)
912 allerror = error;
913 VOP_UNLOCK(pmp->pm_devvp, 0, p);
914 }
915 return (allerror);
916}
917
918static int
918msdosfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
919msdosfs_fhtovp(mp, fhp, vpp)
919 struct mount *mp;
920 struct fid *fhp;
920 struct mount *mp;
921 struct fid *fhp;
921 struct sockaddr *nam;
922 struct vnode **vpp;
922 struct vnode **vpp;
923 int *exflagsp;
924 struct ucred **credanonp;
925{
926 struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
927 struct defid *defhp = (struct defid *) fhp;
928 struct denode *dep;
923{
924 struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
925 struct defid *defhp = (struct defid *) fhp;
926 struct denode *dep;
929 struct netcred *np;
930 int error;
931
927 int error;
928
932 np = vfs_export_lookup(mp, &pmp->pm_export, nam);
933 if (np == NULL)
934 return (EACCES);
935 error = deget(pmp, defhp->defid_dirclust, defhp->defid_dirofs, &dep);
936 if (error) {
937 *vpp = NULLVP;
938 return (error);
939 }
940 *vpp = DETOV(dep);
929 error = deget(pmp, defhp->defid_dirclust, defhp->defid_dirofs, &dep);
930 if (error) {
931 *vpp = NULLVP;
932 return (error);
933 }
934 *vpp = DETOV(dep);
935 return (0);
936}
937
938static int
939msdosfs_checkexp(mp, nam, exflagsp, credanonp)
940 struct mount *mp;
941 struct sockaddr *nam;
942 int *exflagsp;
943 struct ucred **credanonp;
944{
945 struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
946 struct netcred *np;
947
948 np = vfs_export_lookup(mp, &pmp->pm_export, nam);
949 if (np == NULL)
950 return (EACCES);
941 *exflagsp = np->netc_exflags;
942 *credanonp = &np->netc_anon;
943 return (0);
944}
945
946static int
947msdosfs_vptofh(vp, fhp)
948 struct vnode *vp;

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

965 vfs_stdstart,
966 msdosfs_unmount,
967 msdosfs_root,
968 vfs_stdquotactl,
969 msdosfs_statfs,
970 msdosfs_sync,
971 vfs_stdvget,
972 msdosfs_fhtovp,
951 *exflagsp = np->netc_exflags;
952 *credanonp = &np->netc_anon;
953 return (0);
954}
955
956static int
957msdosfs_vptofh(vp, fhp)
958 struct vnode *vp;

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

975 vfs_stdstart,
976 msdosfs_unmount,
977 msdosfs_root,
978 vfs_stdquotactl,
979 msdosfs_statfs,
980 msdosfs_sync,
981 vfs_stdvget,
982 msdosfs_fhtovp,
983 msdosfs_checkexp,
973 msdosfs_vptofh,
974 msdosfs_init
975};
976
977VFS_SET(msdosfs_vfsops, msdos, 0);
984 msdosfs_vptofh,
985 msdosfs_init
986};
987
988VFS_SET(msdosfs_vfsops, msdos, 0);