From: Artem Bityutskiy <Artem.Bityutskiy@xxxxxxxxx> In '__mark_inode_dirty()', when the corresponding bdi was not properly registered, we print a warning. But the corresponding code is a bit untidy, it used if and 'WARN_ON(1)' and printk. This patch turns it into one multi-line WARN() statement which looks tidier and also uses 'unlikely()' for the condition which might matter a tiny bit for this hot-path function. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@xxxxxxxxx> --- fs/fs-writeback.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 559092d..83662fb 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -981,12 +981,9 @@ void __mark_inode_dirty(struct inode *inode, int flags) struct bdi_writeback *wb = &inode_to_bdi(inode)->wb; struct backing_dev_info *bdi = wb->bdi; - if (bdi_cap_writeback_dirty(bdi) && - !test_bit(BDI_registered, &bdi->state)) { - WARN_ON(1); - printk(KERN_ERR "bdi-%s not registered\n", - bdi->name); - } + WARN(bdi_cap_writeback_dirty(bdi) && + !test_bit(BDI_registered, &bdi->state), + "bdi-%s not registered\n", bdi->name); inode->dirtied_when = jiffies; list_move(&inode->i_list, &wb->b_dirty); -- 1.7.1.1 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html