From cb2d7c85a85791923bd76d6e730efe888d456b05 Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 15 Feb 2007 22:08:35 +0000 Subject: Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method. This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs --- sys/sys/mount.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sys/sys/mount.h') diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 640646b..fc1c186 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -525,7 +525,11 @@ typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags, typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, struct vnode **vpp); typedef int vfs_checkexp_t(struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp); +#if __FreeBSD_version < 800000 typedef int vfs_vptofh_t(struct vnode *vp, struct fid *fhp); +#else +#error Remove this code, vfs_vptofh was replaced with vop_vptofh. +#endif typedef int vfs_init_t(struct vfsconf *); typedef int vfs_uninit_t(struct vfsconf *); typedef int vfs_extattrctl_t(struct mount *mp, int cmd, @@ -546,7 +550,11 @@ struct vfsops { vfs_vget_t *vfs_vget; vfs_fhtovp_t *vfs_fhtovp; vfs_checkexp_t *vfs_checkexp; +#if __FreeBSD_version < 800000 vfs_vptofh_t *vfs_vptofh; +#else +#error Remove this code, vfs_vptofh was replaced with vop_vptofh. +#endif vfs_init_t *vfs_init; vfs_uninit_t *vfs_uninit; vfs_extattrctl_t *vfs_extattrctl; @@ -566,7 +574,11 @@ vfs_statfs_t __vfs_statfs; (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) #define VFS_FHTOVP(MP, FIDP, VPP) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) -#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) +#if __FreeBSD_version < 800000 +#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) +#else +#error Remove this code, vfs_vptofh was replaced with vop_vptofh. +#endif #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED) #define VFS_EXTATTRCTL(MP, C, FN, NS, N, P) \ @@ -693,7 +705,11 @@ vfs_sync_t vfs_stdnosync; vfs_vget_t vfs_stdvget; vfs_fhtovp_t vfs_stdfhtovp; vfs_checkexp_t vfs_stdcheckexp; +#if __FreeBSD_version < 800000 vfs_vptofh_t vfs_stdvptofh; +#else +#error Remove this code, vfs_vptofh was replaced with vop_vptofh. +#endif vfs_init_t vfs_stdinit; vfs_uninit_t vfs_stduninit; vfs_extattrctl_t vfs_stdextattrctl; -- cgit v1.1