diff options
author | pjd <pjd@FreeBSD.org> | 2010-12-21 21:59:21 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-12-21 21:59:21 +0000 |
commit | f097c06091d0dba99e738f1e0260f3c1e0245bad (patch) | |
tree | 4184e70b908373fac525d5ad522447316851f190 /sys/sys/mount.h | |
parent | 822e0f931084552d9e1e059285ffef0e1af2ab81 (diff) | |
download | FreeBSD-src-f097c06091d0dba99e738f1e0260f3c1e0245bad.zip FreeBSD-src-f097c06091d0dba99e738f1e0260f3c1e0245bad.tar.gz |
Close body of the VFS_UNLOCK_GIANT() macro into do { } while (0) loop,
so it can be used in code like this:
if (cond)
VFS_UNLOCK_GIANT(vfslocked);
else
; /* Do something else. */
Before the change, compiler couldn't decide on its own if else should be
applied to the 'if (cond)' or to the if statement inside VFS_UNLOCK_GIANT()
macro.
Diffstat (limited to 'sys/sys/mount.h')
-rw-r--r-- | sys/sys/mount.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h index be605b4..231e3d6 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -644,7 +644,11 @@ vfs_statfs_t __vfs_statfs; _locked = 0; \ _locked; \ }) -#define VFS_UNLOCK_GIANT(locked) if ((locked)) mtx_unlock(&Giant); +#define VFS_UNLOCK_GIANT(locked) do \ +{ \ + if ((locked)) \ + mtx_unlock(&Giant); \ +} while (0) #define VFS_ASSERT_GIANT(MP) do \ { \ struct mount *_mp; \ |