/* So, if we see any bmap calls here on a modified, data-journaled file, take extra steps to flush any blocks which might be in the cache.  */
static sector_t ext3_bmap(struct address_space *mapping, sector_t block)
/* So, if we see any bmap calls here on a modified, data-journaled file, take extra steps to flush any blocks which might be in the cache.  */
static sector_t ext3_bmap(struct address_space *mapping, sector_t block)
{
	struct inode *inode = mapping->host;
	journal_t *journal;
	int err;
	if (EXT3_I(inode)->i_state & EXT3_STATE_JDATA) {
		EXT3_I(inode)->i_state &= ~EXT3_STATE_JDATA;
		journal = EXT3_JOURNAL(inode);
		journal_lock_updates(journal);
		err = journal_flush(journal);
		journal_unlock_updates(journal);
		if (err)
			return 0;
	}
	return generic_block_bmap(mapping,block,ext3_get_block);
}