From owner-svn-src-all@FreeBSD.ORG Tue Dec 21 21:59:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66542106564A; Tue, 21 Dec 2010 21:59:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55D018FC0C; Tue, 21 Dec 2010 21:59:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBLLxLir076605; Tue, 21 Dec 2010 21:59:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBLLxLKA076603; Tue, 21 Dec 2010 21:59:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012212159.oBLLxLKA076603@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 21 Dec 2010 21:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216626 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2010 21:59:21 -0000 Author: pjd Date: Tue Dec 21 21:59:21 2010 New Revision: 216626 URL: http://svn.freebsd.org/changeset/base/216626 Log: 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. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Dec 21 21:32:17 2010 (r216625) +++ head/sys/sys/mount.h Tue Dec 21 21:59:21 2010 (r216626) @@ -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; \