Deleted Added
full compact
fdesc_vfsops.c (28270) fdesc_vfsops.c (30354)
1/*
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
37 *
1/*
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94
37 *
38 * $Id: fdesc_vfsops.c,v 1.11 1997/08/02 14:31:59 bde Exp $
38 * $Id: fdesc_vfsops.c,v 1.12 1997/08/16 19:15:12 wollman Exp $
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/proc.h>
49#include <sys/resourcevar.h>
50#include <sys/filedesc.h>
51#include <sys/vnode.h>
52#include <sys/mount.h>
53#include <sys/malloc.h>
54#include <miscfs/fdesc/fdesc.h>
55
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/proc.h>
49#include <sys/resourcevar.h>
50#include <sys/filedesc.h>
51#include <sys/vnode.h>
52#include <sys/mount.h>
53#include <sys/malloc.h>
54#include <miscfs/fdesc/fdesc.h>
55
56static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
57
56static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp,
57 struct mbuf *nam, struct vnode **vpp,
58 int *exflagsp, struct ucred **credanonp));
59static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
60 struct nameidata *ndp, struct proc *p));
61static int fdesc_quotactl __P((struct mount *mp, int cmd, uid_t uid,
62 caddr_t arg, struct proc *p));
63static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));

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

93 if (mp->mnt_flag & MNT_UPDATE)
94 return (EOPNOTSUPP);
95
96 error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp);
97 if (error)
98 return (error);
99
100 MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount),
58static int fdesc_fhtovp __P((struct mount *mp, struct fid *fhp,
59 struct mbuf *nam, struct vnode **vpp,
60 int *exflagsp, struct ucred **credanonp));
61static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
62 struct nameidata *ndp, struct proc *p));
63static int fdesc_quotactl __P((struct mount *mp, int cmd, uid_t uid,
64 caddr_t arg, struct proc *p));
65static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));

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

95 if (mp->mnt_flag & MNT_UPDATE)
96 return (EOPNOTSUPP);
97
98 error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp);
99 if (error)
100 return (error);
101
102 MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount),
101 M_UFSMNT, M_WAITOK); /* XXX */
103 M_FDESCMNT, M_WAITOK); /* XXX */
102 rvp->v_type = VDIR;
103 rvp->v_flag |= VROOT;
104 fmp->f_root = rvp;
105 /* XXX -- don't mark as local to work around fts() problems */
106 /*mp->mnt_flag |= MNT_LOCAL;*/
107 mp->mnt_data = (qaddr_t) fmp;
108 vfs_getnewfsid(mp);
109

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

153 vrele(rootvp);
154 /*
155 * And blow it away for future re-use
156 */
157 vgone(rootvp);
158 /*
159 * Finally, throw away the fdescmount structure
160 */
104 rvp->v_type = VDIR;
105 rvp->v_flag |= VROOT;
106 fmp->f_root = rvp;
107 /* XXX -- don't mark as local to work around fts() problems */
108 /*mp->mnt_flag |= MNT_LOCAL;*/
109 mp->mnt_data = (qaddr_t) fmp;
110 vfs_getnewfsid(mp);
111

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

155 vrele(rootvp);
156 /*
157 * And blow it away for future re-use
158 */
159 vgone(rootvp);
160 /*
161 * Finally, throw away the fdescmount structure
162 */
161 free(mp->mnt_data, M_UFSMNT); /* XXX */
163 free(mp->mnt_data, M_FDESCMNT); /* XXX */
162 mp->mnt_data = 0;
163
164 return (0);
165}
166
167int
168fdesc_root(mp, vpp)
169 struct mount *mp;

--- 101 unchanged lines hidden ---
164 mp->mnt_data = 0;
165
166 return (0);
167}
168
169int
170fdesc_root(mp, vpp)
171 struct mount *mp;

--- 101 unchanged lines hidden ---