X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/9faed91670d13f72e0b1159a507ef81af78fe49b..ca466baeb91097acf0817cd63a0c33886ca69d31:/sys/vfs/fdesc/fdesc_vfsops.c diff --git a/sys/vfs/fdesc/fdesc_vfsops.c b/sys/vfs/fdesc/fdesc_vfsops.c index 3dbe5837d2..f39d25d746 100644 --- a/sys/vfs/fdesc/fdesc_vfsops.c +++ b/sys/vfs/fdesc/fdesc_vfsops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vfsops.c,v 1.22.2.3 2002/08/23 17:42:39 njl Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.10 2004/10/12 19:20:53 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.18 2006/05/05 21:15:09 dillon Exp $ */ /* @@ -77,7 +77,6 @@ fdesc_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) int error = 0; struct fdescmount *fmp; struct vnode *rvp; - size_t size; if (path == NULL) panic("fdesc_mount: cannot mount as root"); @@ -88,7 +87,8 @@ fdesc_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) if (mp->mnt_flag & MNT_UPDATE) return (EOPNOTSUPP); - vfs_add_vnodeops(&mp->mnt_vn_ops, fdesc_vnodeop_entries); + vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, + fdesc_vnodeop_entries, 0); error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp, td); if (error) @@ -104,11 +104,9 @@ fdesc_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) mp->mnt_data = (qaddr_t) fmp; vfs_getnewfsid(mp); - (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size); - bzero(mp->mnt_stat.f_mntonname + size, MNAMELEN - size); bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); bcopy("fdesc", mp->mnt_stat.f_mntfromname, sizeof("fdesc")); - (void)fdesc_statfs(mp, &mp->mnt_stat, td); + fdesc_statfs(mp, &mp->mnt_stat, td); return (0); } @@ -144,7 +142,6 @@ fdesc_unmount(struct mount *mp, int mntflags, struct thread *td) int fdesc_root(struct mount *mp, struct vnode **vpp) { - struct thread *td = curthread; /* XXX */ struct vnode *vp; /* @@ -152,7 +149,7 @@ fdesc_root(struct mount *mp, struct vnode **vpp) */ vp = VFSTOFDESC(mp)->f_root; vref(vp); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); *vpp = vp; return (0); } @@ -180,7 +177,7 @@ fdesc_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) last = min(fdp->fd_nfiles, lim); freefd = 0; for (i = fdp->fd_freefile; i < last; i++) - if (fdp->fd_ofiles[i] == NULL) + if (fdp->fd_files[i].fp == NULL) freefd++; /* @@ -201,27 +198,19 @@ fdesc_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) if (sbp != &mp->mnt_stat) { sbp->f_type = mp->mnt_vfc->vfc_typenum; bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid)); - bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN); bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN); } return (0); } static struct vfsops fdesc_vfsops = { - fdesc_mount, - vfs_stdstart, - fdesc_unmount, - fdesc_root, - vfs_stdquotactl, - fdesc_statfs, - vfs_stdsync, - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - fdesc_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = fdesc_mount, + .vfs_unmount = fdesc_unmount, + .vfs_root = fdesc_root, + .vfs_statfs = fdesc_statfs, + .vfs_sync = vfs_stdsync, + .vfs_init = fdesc_init, + .vfs_uninit = fdesc_uninit }; VFS_SET(fdesc_vfsops, fdesc, VFCF_SYNTHETIC);