lkml.org 
[lkml]   [2005]   [Sep]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 5 Sep 2005 10:58:08 +0200
FromJörn Engel <>
SubjectRe: GFS, what's remaining
On Mon, 5 September 2005 11:47:39 +0800, David Teigland wrote:
> 
> Joern already suggested moving this out of line and into a function (as it
> was before) to avoid repeating string constants.  In that case the
> function, file and line from BUG aren't useful.  We now have this, does it
> look ok?

Ok wrt. my concerns, but not with Greg's.  BUG() still gives you
everything that you need, except:
o fsid

Notice how this list is just one entry long? ;)

So how about


#define gfs2_assert(sdp, assertion) do {			\
	if (unlikely(!(assertion))) {				\
	printk(KERN_ERR "GFS2: fsid=\n", (sdp)->sd_fsname);	\
	BUG();							\
} while (0)

Or, to move the constant out of line again


void __gfs2_assert(struct gfs2_sbd *sdp) {
	printk(KERN_ERR "GFS2: fsid=\n", sdp->sd_fsname);
}
#define gfs2_assert(sdp, assertion) do {\
	if (unlikely(!(assertion))) {	\
	__gfs2_assert(sdp);		\
	BUG();				\
} while (0)

Jörn

-- 
Admonish your friends privately, but praise them openly.
-- Publilius Syrus 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-05 11:00    [from the cache]
©2003-2008