|
|
| version 1.11, 2003/10/19 18:11:37 | version 1.12, 2004/02/05 21:03:37 |
|---|---|
| Line 68 | Line 68 |
| #include "ntfs_ihash.h" | #include "ntfs_ihash.h" |
| #include "ntfsmount.h" | #include "ntfsmount.h" |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| MALLOC_DEFINE(M_NTFSMNT, "NTFS mount", "NTFS mount structure"); | MALLOC_DEFINE(M_NTFSMNT, "NTFS mount", "NTFS mount structure"); |
| MALLOC_DEFINE(M_NTFSNTNODE,"NTFS ntnode", "NTFS ntnode information"); | MALLOC_DEFINE(M_NTFSNTNODE,"NTFS ntnode", "NTFS ntnode information"); |
| MALLOC_DEFINE(M_NTFSFNODE,"NTFS fnode", "NTFS fnode information"); | MALLOC_DEFINE(M_NTFSFNODE,"NTFS fnode", "NTFS fnode information"); |
| Line 87 static int ntfs_vptofh (struct vnode *, | Line 87 static int ntfs_vptofh (struct vnode *, |
| static int ntfs_fhtovp (struct mount *, struct fid *, | static int ntfs_fhtovp (struct mount *, struct fid *, |
| struct vnode **); | struct vnode **); |
| #if !defined (__FreeBSD__) | #if !defined (__DragonFly__) |
| static int ntfs_quotactl (struct mount *, int, uid_t, caddr_t, | static int ntfs_quotactl (struct mount *, int, uid_t, caddr_t, |
| struct thread *); | struct thread *); |
| static int ntfs_start (struct mount *, int, struct thread *); | static int ntfs_start (struct mount *, int, struct thread *); |
| Line 95 static int ntfs_sync (struct mount *, in | Line 95 static int ntfs_sync (struct mount *, in |
| struct thread *); | struct thread *); |
| #endif | #endif |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| struct sockaddr; | struct sockaddr; |
| static int ntfs_mount (struct mount *, char *, caddr_t, | static int ntfs_mount (struct mount *, char *, caddr_t, |
| struct nameidata *, struct thread *); | struct nameidata *, struct thread *); |
| Line 119 static int ntfs_checkexp (struct mount * | Line 119 static int ntfs_checkexp (struct mount * |
| */ | */ |
| static int | static int |
| ntfs_checkexp(mp, nam, exflagsp, credanonp) | ntfs_checkexp(mp, nam, exflagsp, credanonp) |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| struct mount *mp; | struct mount *mp; |
| struct sockaddr *nam; | struct sockaddr *nam; |
| int *exflagsp; | int *exflagsp; |
| Line 212 ntfs_init () | Line 212 ntfs_init () |
| ntfs_toupper_init(); | ntfs_toupper_init(); |
| } | } |
| #elif defined(__FreeBSD__) | #elif defined(__DragonFly__) |
| static int | static int |
| ntfs_init ( | ntfs_init ( |
| Line 228 ntfs_init ( | Line 228 ntfs_init ( |
| static int | static int |
| ntfs_mount ( | ntfs_mount ( |
| struct mount *mp, | struct mount *mp, |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| char *path, | char *path, |
| caddr_t data, | caddr_t data, |
| #else | #else |
| Line 243 ntfs_mount ( | Line 243 ntfs_mount ( |
| struct vnode *devvp; | struct vnode *devvp; |
| struct ntfs_args args; | struct ntfs_args args; |
| #ifdef __FreeBSD__ | #ifdef __DragonFly__ |
| /* | /* |
| * Use NULL path to flag a root mount | * Use NULL path to flag a root mount |
| */ | */ |
| Line 321 ntfs_mount ( | Line 321 ntfs_mount ( |
| NDFREE(ndp, NDF_ONLY_PNBUF); | NDFREE(ndp, NDF_ONLY_PNBUF); |
| devvp = ndp->ni_vp; | devvp = ndp->ni_vp; |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| if (!vn_isdisk(devvp, &err)) | if (!vn_isdisk(devvp, &err)) |
| goto error_2; | goto error_2; |
| #else | #else |
| Line 391 ntfs_mount ( | Line 391 ntfs_mount ( |
| goto error_2; | goto error_2; |
| } | } |
| #ifdef __FreeBSD__ | #ifdef __DragonFly__ |
| dostatfs: | dostatfs: |
| #endif | #endif |
| /* | /* |
| Line 446 ntfs_mountfs(devvp, mp, argsp, td) | Line 446 ntfs_mountfs(devvp, mp, argsp, td) |
| if (error) | if (error) |
| return (error); | return (error); |
| ncount = vcount(devvp); | ncount = vcount(devvp); |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| if (devvp->v_object) | if (devvp->v_object) |
| ncount -= 1; | ncount -= 1; |
| #endif | #endif |
| if (ncount > 1 && devvp != rootvp) | if (ncount > 1 && devvp != rootvp) |
| return (EBUSY); | return (EBUSY); |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); | VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, td); |
| error = vinvalbuf(devvp, V_SAVE, td, 0, 0); | error = vinvalbuf(devvp, V_SAVE, td, 0, 0); |
| VOP__UNLOCK(devvp, 0, td); | VOP__UNLOCK(devvp, 0, td); |
| Line 603 ntfs_mountfs(devvp, mp, argsp, td) | Line 603 ntfs_mountfs(devvp, mp, argsp, td) |
| vput(vp); | vput(vp); |
| } | } |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); | mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); |
| mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; | mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; |
| #else | #else |
| Line 639 out: | Line 639 out: |
| return (error); | return (error); |
| } | } |
| #if !defined(__FreeBSD__) | #if !defined(__DragonFly__) |
| static int | static int |
| ntfs_start ( | ntfs_start ( |
| struct mount *mp, | struct mount *mp, |
| Line 740 ntfs_root( | Line 740 ntfs_root( |
| return (0); | return (0); |
| } | } |
| #if !defined(__FreeBSD__) | #if !defined(__DragonFly__) |
| static int | static int |
| ntfs_quotactl ( | ntfs_quotactl ( |
| struct mount *mp, | struct mount *mp, |
| Line 800 ntfs_statfs( | Line 800 ntfs_statfs( |
| mftsize = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_size; | mftsize = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_size; |
| mftallocated = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_allocated; | mftallocated = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_allocated; |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| sbp->f_type = mp->mnt_vfc->vfc_typenum; | sbp->f_type = mp->mnt_vfc->vfc_typenum; |
| #elif defined(__NetBSD__) | #elif defined(__NetBSD__) |
| sbp->f_type = 0; | sbp->f_type = 0; |
| Line 828 ntfs_statfs( | Line 828 ntfs_statfs( |
| return (0); | return (0); |
| } | } |
| #if !defined(__FreeBSD__) | #if !defined(__DragonFly__) |
| static int | static int |
| ntfs_sync ( | ntfs_sync ( |
| struct mount *mp, | struct mount *mp, |
| Line 970 ntfs_vgetex( | Line 970 ntfs_vgetex( |
| } | } |
| dprintf(("ntfs_vget: vnode: %p for ntnode: %d\n", vp,ino)); | dprintf(("ntfs_vget: vnode: %p for ntnode: %d\n", vp,ino)); |
| #ifdef __FreeBSD__ | #ifdef __DragonFly__ |
| lockinit(&fp->f_lock, 0, "fnode", VLKTIMEOUT, 0); | lockinit(&fp->f_lock, 0, "fnode", VLKTIMEOUT, 0); |
| #endif | #endif |
| fp->f_vp = vp; | fp->f_vp = vp; |
| Line 1005 ntfs_vget( | Line 1005 ntfs_vget( |
| LK_EXCLUSIVE | LK_RETRY, 0, curthread, vpp); | LK_EXCLUSIVE | LK_RETRY, 0, curthread, vpp); |
| } | } |
| #if defined(__FreeBSD__) | #if defined(__DragonFly__) |
| static struct vfsops ntfs_vfsops = { | static struct vfsops ntfs_vfsops = { |
| ntfs_mount, | ntfs_mount, |
| vfs_stdstart, | vfs_stdstart, |