Deleted Added
full compact
fdesc_vfsops.c (50477) fdesc_vfsops.c (51068)
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 * $FreeBSD: head/sys/fs/fdescfs/fdesc_vfsops.c 50477 1999-08-28 01:08:13Z peter $
38 * $FreeBSD: head/sys/fs/fdescfs/fdesc_vfsops.c 51068 1999-09-07 22:42:38Z alfred $
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

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

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
58static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
59 struct nameidata *ndp, struct proc *p));
39 */
40
41/*
42 * /dev/fd Filesystem
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

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

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
58static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
59 struct nameidata *ndp, struct proc *p));
60static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));
61static int fdesc_unmount __P((struct mount *mp, int mntflags,
62 struct proc *p));
63static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
64 struct proc *p));
60static int fdesc_unmount __P((struct mount *mp, int mntflags,
61 struct proc *p));
62static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
63 struct proc *p));
65static int fdesc_sync __P((struct mount *mp, int waitfor,
66 struct ucred *cred, struct proc *p));
67
68/*
69 * Mount the per-process file descriptors (/dev/fd)
70 */
71static int
72fdesc_mount(mp, path, data, ndp, p)
73 struct mount *mp;
74 char *path;

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

105 bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
106 bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
107 bcopy("fdesc", mp->mnt_stat.f_mntfromname, sizeof("fdesc"));
108 (void)fdesc_statfs(mp, &mp->mnt_stat, p);
109 return (0);
110}
111
112static int
64
65/*
66 * Mount the per-process file descriptors (/dev/fd)
67 */
68static int
69fdesc_mount(mp, path, data, ndp, p)
70 struct mount *mp;
71 char *path;

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

102 bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size);
103 bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
104 bcopy("fdesc", mp->mnt_stat.f_mntfromname, sizeof("fdesc"));
105 (void)fdesc_statfs(mp, &mp->mnt_stat, p);
106 return (0);
107}
108
109static int
113fdesc_start(mp, flags, p)
114 struct mount *mp;
115 int flags;
116 struct proc *p;
117{
118 return (0);
119}
120
121static int
122fdesc_unmount(mp, mntflags, p)
123 struct mount *mp;
124 int mntflags;
125 struct proc *p;
126{
127 int error;
128 int flags = 0;
129 struct vnode *rootvp = VFSTOFDESC(mp)->f_root;

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

221 sbp->f_type = mp->mnt_vfc->vfc_typenum;
222 bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
223 bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
224 bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
225 }
226 return (0);
227}
228
110fdesc_unmount(mp, mntflags, p)
111 struct mount *mp;
112 int mntflags;
113 struct proc *p;
114{
115 int error;
116 int flags = 0;
117 struct vnode *rootvp = VFSTOFDESC(mp)->f_root;

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

209 sbp->f_type = mp->mnt_vfc->vfc_typenum;
210 bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
211 bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
212 bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
213 }
214 return (0);
215}
216
229static int
230fdesc_sync(mp, waitfor, cred, p)
231 struct mount *mp;
232 int waitfor;
233 struct ucred *cred;
234 struct proc *p;
235{
236
237 return (0);
238}
239
240#define fdesc_fhtovp ((int (*) __P((struct mount *, struct fid *, \
241 struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
242#define fdesc_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
243 struct proc *)))eopnotsupp)
244#define fdesc_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
245 size_t, struct proc *)))eopnotsupp)
246#define fdesc_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
247 eopnotsupp)
248#define fdesc_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
249
250static struct vfsops fdesc_vfsops = {
251 fdesc_mount,
217static struct vfsops fdesc_vfsops = {
218 fdesc_mount,
252 fdesc_start,
219 vfs_stdstart,
253 fdesc_unmount,
254 fdesc_root,
220 fdesc_unmount,
221 fdesc_root,
255 fdesc_quotactl,
222 vfs_stdquotactl,
256 fdesc_statfs,
223 fdesc_statfs,
257 fdesc_sync,
258 fdesc_vget,
259 fdesc_fhtovp,
260 fdesc_vptofh,
224 vfs_stdsync,
225 vfs_stdvget,
226 vfs_stdfhtovp,
227 vfs_stdvptofh,
261 fdesc_init,
262};
263
264VFS_SET(fdesc_vfsops, fdesc, VFCF_SYNTHETIC);
228 fdesc_init,
229};
230
231VFS_SET(fdesc_vfsops, fdesc, VFCF_SYNTHETIC);