RE: Fix unlock_buffer() to work the same way as bit_unlock()

From: Boehm, Hans <>
Date: 2006-03-31 04:57:40
> From: Christoph Lameter 
> On Thu, 30 Mar 2006, Zoltan Menyhart wrote:
> > Form semantical point of view, the forms:
> > 
> > 	bit_foo(..., mode)
> > and
> > 	bit_foo_mode(...)
> > 
> > are equivalent.
> Correct but the above form leads to less macro definitions.
> > However, I do not think your implementation would be 
> efficient due to 
> > selecting the ordering mode at run time:
> The compiler will select that at compile time. One has the 
> option of also generating run time seletion by specifying a 
> variable instead of a constant when callig these functions.
I would view the latter as a disadvantage, since I can't think of a case
in which you wouldn't want it reported as an error instead, at least if
you care about performance.  If you know of one, I'd be very interested.

The first form does have the advantage that it's possible to build up
more complicated primitives from simpler ones without repeating the
definition four times.

I'm not sure there's a clear winner here.

In the C++ case, I currently expect we will go with template arguments,
which are guaranteed to be static, but are an option you don't have ...

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Fri Mar 31 04:58:18 2006

This archive was generated by hypermail 2.1.8 : 2006-03-31 04:58:27 EST