How about
#define assert_nonblock __set_blocking(__LINE__, __FILE__)
#define end_nonblock __end_blocking()
void __set_blocking(const char *p1, const char *p2)
{
if(nblocks>=MAX_BLOCKS)
printk(KERN_ERR "Block checker stack depth exceeded.\n");
bptr=&blocks[nblocks++];
bptr->line=line;
bptr->file=file;
}
void _end_blocking()
{
if(!nblocks)
printk(KERN_ERR "Unbalance on block checker.\n");
else
nblocks--;
}
and an
if(nblocks)
{
for(i=0;i<nblocks;i++)
printk(KERN_ERR "block assert fail (%s:%s)\n",
blocks[i].file,blocks[i].line);
}
check in schedule or the sleep_on functions
if a debug option is set
Alan