From: Tomohiro Kusumi Date: Sat, 9 May 2015 21:28:25 +0000 (+0900) Subject: sys/sys: Remove VFS_MPLOCK2 macro X-Git-Tag: v4.2.0rc~204 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e47b73c65d312cf196178b1110166a8d203abaeb sys/sys: Remove VFS_MPLOCK2 macro - Not only vfs and filesystems are NOT using this macro, but also this macro doesn't work given that - The local variable 'xlock_mpsafe' (which is visibly hidden from vfs C code) is being used without initializing, while this header doesn't provide a macro to initialze it. (even if it did provide the purpose of VFS_MPLOCK2 isn't very clear either). - VFS_MPLOCK1 is the only one that works as expected and all the syscalls actually use this. Replacing VFS_MPLOCK1 with VFS_MPLOCK2 results compile error with -Werror=uninitialized. error: 'xlock_mpsafe' is used uninitialized in this function [-Werror=uninitialized] if (xlock_mpsafe) { --- diff --git a/sys/kern/vfs_vopops.c b/sys/kern/vfs_vopops.c index 7811295449..e67057fce4 100644 --- a/sys/kern/vfs_vopops.c +++ b/sys/kern/vfs_vopops.c @@ -162,8 +162,7 @@ VNODEOP_DESC_INIT(nrename); * vop_old_*(). Only the code in vfs_default.c is allowed to call * those ops. * - * NOTE: The VFS_MPLOCK*() macros handle mounts which do not set - * MNTK_MPSAFE or MNTK_xx_MPSAFE. + * NOTE: The VFS_MPLOCK1() macro handle mounts which do not set MNTK_MPSAFE. * * MPSAFE */ diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 00b0473510..1e060c537e 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -391,15 +391,6 @@ struct mount { #define VFS_MPLOCK1(mp) VFS_MPLOCK_FLAG(mp, MNTK_MPSAFE) -#define VFS_MPLOCK2(mp) \ - do { \ - if (xlock_mpsafe) { \ - get_mplock(); /* TEMPORARY */ \ - lwkt_gettoken(&mp->mnt_token); \ - xlock_mpsafe = 0; \ - } \ - } while(0) - #define VFS_MPLOCK_FLAG(mp, flag) \ do { \ if (mp->mnt_kern_flag & flag) { \