Re: [2.6 patch] fs/block_dev.c:I_BDEV() mustn't be inline

From: Al Viro
Date: Mon Apr 28 2008 - 21:12:26 EST


On Mon, Apr 28, 2008 at 05:41:11PM -0700, Linus Torvalds wrote:

> There is NO WAY IN HELL this function shouldn't be inlined, and it doesn't
> matter a whit if some users outside of this file then also want the
> non-inlined version.

AFAICS, it's a gcc bug. We have
extern struct block_device *I_BDEV(struct inode *inode);
followed by
inline struct block_device *I_BDEV(struct inode *inode)
{
...
}

and presence of declaration with extern within the same translation unit
means that definition we have here is an external one, per 6.7.4. It's
perfectly legitimate and gcc has no business complaining about inline
here; moreover, example in 6.7.4(7) is essentially the same thing...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/