sys/sys: Remove VFS_MPLOCK2 macro
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 9 May 2015 21:28:25 +0000 (06:28 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 10 May 2015 12:00:04 +0000 (21:00 +0900)
- 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) {

sys/kern/vfs_vopops.c
sys/sys/mount.h

index 7811295..e67057f 100644 (file)
@@ -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
  */
index 00b0473..1e060c5 100644 (file)
@@ -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) {                 \