From 028240329c09b6a311cb85736f41d75f7ee7a01f Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Wed, 17 Mar 2010 01:55:41 -0400 Subject: [PATCH] Catch up with FBSD80's removal of thread argument to VFS calls FreeBSD SVN rev 191990 removed the thread argument to filesystem-dependent VFS calls. Curthread is always assumed. There is a __FreeBSD_version bump that we could check if we felt like being precise, but FBSD80_ENV is probably good enough. Change-Id: I4534f01999b61eaeaa014c41473c693e6d432fef Reviewed-on: http://gerrit.openafs.org/1587 Reviewed-by: Derrick Brashear Tested-by: Benjamin Kaduk --- src/afs/FBSD/osi_prototypes.h | 4 +++- src/afs/FBSD/osi_vfsops.c | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/afs/FBSD/osi_prototypes.h b/src/afs/FBSD/osi_prototypes.h index 3788f86..f2efcb7 100644 --- a/src/afs/FBSD/osi_prototypes.h +++ b/src/afs/FBSD/osi_prototypes.h @@ -26,7 +26,9 @@ extern void osi_fbsd_free(void *p); /* osi_vfsops.c */ int afs_init(struct vfsconf *vfc); int afs_uninit(struct vfsconf *vfc); -#ifdef AFS_FBSD50_ENV +#if defined(AFS_FBSD80_ENV) +extern int afs_statfs(struct mount *mp, struct statfs *abp); +#elif defined(AFS_FBSD50_ENV) extern int afs_statfs(struct mount *mp, struct statfs *abp, struct thread *th); #else extern int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p); diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 8f97ae0..b9766fd 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -70,7 +70,9 @@ afs_start(struct mount *mp, int flags, THREAD_OR_PROC) } int -#ifdef AFS_FBSD53_ENV +#if defined(AFS_FBSD80_ENV) +afs_omount(struct mount *mp, char *path, caddr_t data) +#elif defined(AFS_FBSD53_ENV) afs_omount(struct mount *mp, char *path, caddr_t data, struct thread *p) #else afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, @@ -115,29 +117,49 @@ afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, MNT_IUNLOCK(mp); #endif AFS_GUNLOCK(); +#ifdef AFS_FBSD80_ENV + afs_statfs(mp, &mp->mnt_stat); +#else afs_statfs(mp, &mp->mnt_stat, p); +#endif return 0; } #ifdef AFS_FBSD53_ENV int +#ifdef AFS_FBSD80_ENV +afs_mount(struct mount *mp) +#else afs_mount(struct mount *mp, struct thread *td) +#endif { +#ifdef AFS_FBSD80_ENV + return afs_omount(mp, NULL, NULL); +#else return afs_omount(mp, NULL, NULL, td); +#endif } #endif #ifdef AFS_FBSD60_ENV static int +#ifdef AFS_FBSD80_ENV +afs_cmount(struct mntarg *ma, void *data, int flags) +#else afs_cmount(struct mntarg *ma, void *data, int flags, struct thread *td) +#endif { return kernel_mount(ma, flags); } #endif int +#ifdef AFS_FBSD80_ENV +afs_unmount(struct mount *mp, int flags) +#else afs_unmount(struct mount *mp, int flags, THREAD_OR_PROC) +#endif { /* @@ -245,7 +267,11 @@ tryagain: } int +#ifdef AFS_FBSD80_ENV +afs_statfs(struct mount *mp, struct statfs *abp) +#else afs_statfs(struct mount *mp, struct statfs *abp, THREAD_OR_PROC) +#endif { AFS_GLOCK(); AFS_STATCNT(afs_statfs); @@ -275,7 +301,9 @@ afs_statfs(struct mount *mp, struct statfs *abp, THREAD_OR_PROC) } int -#ifdef AFS_FBSD60_ENV +#if defined(AFS_FBSD80_ENV) +afs_sync(struct mount *mp, int waitfor) +#elif defined(AFS_FBSD60_ENV) afs_sync(struct mount *mp, int waitfor, struct thread *td) #else afs_sync(struct mount *mp, int waitfor, struct ucred *cred, THREAD_OR_PROC) -- 1.9.4