File system query

Alexandru Juncu alexj at rosedu.org
Tue Jun 25 02:56:43 EDT 2013


On 23 June 2013 17:18, Dibyayan Chakraborty <dib.coolguy at gmail.com> wrote:
> Hi,
> I came by a really weird macro code in linux/jbd.h which is
>
> BUFFER_TRACE(bh,info)  do{} while(0).
>
> Please explain the necessity of this.

I'm not familiar with that specific code, but it looks like a "no op"
macro. Maybe the definition is the to ensure backwards or forward
compatibility for the code that calls the macro , but now it doesn't
do anything.

For the reason why there is a while(0), instead of just no code there,
take a look at this:

http://kernelnewbies.org/FAQ/DoWhile0


Hope this helps.



More information about the Kernelnewbies mailing list