Date: Mon, 14 Jul 2014 08:59:25 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268610 - head/sys/fs/tmpfs Message-ID: <201407140859.s6E8xPuw038573@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jul 14 08:59:25 2014 New Revision: 268610 URL: http://svnweb.freebsd.org/changeset/base/268610 Log: Add convenience macro to assert tmpfs node lock. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Mon Jul 14 08:55:02 2014 (r268609) +++ head/sys/fs/tmpfs/tmpfs.h Mon Jul 14 08:59:25 2014 (r268610) @@ -276,6 +276,8 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_NODE_LOCK(node) mtx_lock(&(node)->tn_interlock) #define TMPFS_NODE_UNLOCK(node) mtx_unlock(&(node)->tn_interlock) #define TMPFS_NODE_MTX(node) (&(node)->tn_interlock) +#define TMPFS_NODE_ASSERT_LOCKED(node) mtx_assert(TMPFS_NODE_MTX(node), \ + MA_OWNED) #ifdef INVARIANTS #define TMPFS_ASSERT_LOCKED(node) do { \ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 14 08:55:02 2014 (r268609) +++ head/sys/fs/tmpfs/tmpfs_subr.c Mon Jul 14 08:59:25 2014 (r268610) @@ -633,7 +633,7 @@ tmpfs_free_vp(struct vnode *vp) node = VP_TO_TMPFS_NODE(vp); - mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); + TMPFS_NODE_ASSERT_LOCKED(node); node->tn_vnode = NULL; if ((node->tn_vpstate & TMPFS_VNODE_WRECLAIM) != 0) wakeup(&node->tn_vnode);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407140859.s6E8xPuw038573>