From: Ben Kaduk Date: Wed, 7 Nov 2012 15:08:33 +0000 (-0500) Subject: Catch up to FreeBSD non-MPSAFE deorbit X-Git-Tag: upstream/1.6.2_pre2^2~87 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=85794b6561b132477aa74134ccce58c6eaa27f70;p=packages%2Fo%2Fopenafs.git Catch up to FreeBSD non-MPSAFE deorbit All filesystems must have their own locking now. We have been MPSAFE for quite some time, but the preprocessor macro "MPSAFE" has been removed and we must catch up in order to compile. The MNTK_MPSAFE macro has not yet been removed, but it is toothless now, so we can preemptively stop using it. Reviewed-on: http://gerrit.openafs.org/8366 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit f749f17fe1a2bc56a8129f5579e5cf5009f12d95) Change-Id: I35ad1c63bf3b1c91035bcdd29d7cfcb5603dfd12 Reviewed-on: http://gerrit.openafs.org/8374 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/FBSD/osi_misc.c b/src/afs/FBSD/osi_misc.c index 04fe165a8..5fdd4612e 100644 --- a/src/afs/FBSD/osi_misc.c +++ b/src/afs/FBSD/osi_misc.c @@ -31,7 +31,11 @@ osi_lookupname(char *aname, enum uio_seg seg, int followlink, if (glocked) AFS_GUNLOCK(); +#if __FreeBSD_version >= 1000021 /* MPSAFE is gone for good! */ + flags = LOCKLEAF; +#else flags = LOCKLEAF | MPSAFE; /* namei must take Giant if needed */ +#endif if (followlink) flags |= FOLLOW; else diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index b300ff4d6..3311e94ae 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -135,7 +135,9 @@ afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp, #if defined(AFS_FBSD61_ENV) && !defined(AFS_FBSD62_ENV) MNT_ILOCK(mp); #endif +#if __FreeBSD_version < 1000021 mp->mnt_kern_flag |= MNTK_MPSAFE; /* solid steel */ +#endif #ifndef AFS_FBSD61_ENV MNT_ILOCK(mp); #endif diff --git a/src/afs/FBSD/osi_vnodeops.c b/src/afs/FBSD/osi_vnodeops.c index 11d8cfee7..01498fa8b 100644 --- a/src/afs/FBSD/osi_vnodeops.c +++ b/src/afs/FBSD/osi_vnodeops.c @@ -501,7 +501,9 @@ afs_vop_lookup(ap) lockparent = flags & LOCKPARENT; wantparent = flags & (LOCKPARENT | WANTPARENT); +#if __FreeBSD_version < 1000021 cnp->cn_flags |= MPSAFE; /* steel */ +#endif if (flags & ISDOTDOT) MA_VOP_UNLOCK(dvp, 0, p);