/* This function must not block. So, the alloc can't block. In the worst case, it is ok to fail. It would simply mean we can't clear the region. Does nothing to current sync context, but does mean the region will be re-sync'ed on a reload of the mirror even though it is in-sync.  */
static void userspace_clear_region(struct dm_dirty_log *log, region_t region)
/* This function must not block. So, the alloc can't block. In the worst case, it is ok to fail. It would simply mean we can't clear the region. Does nothing to current sync context, but does mean the region will be re-sync'ed on a reload of the mirror even though it is in-sync.  */
static void userspace_clear_region(struct dm_dirty_log *log, region_t region)
{
	unsigned long flags;
	struct log_c *lc = log->context;
	struct flush_entry *fe;
	fe = mempool_alloc(flush_entry_pool, GFP_ATOMIC);
	if (!fe) {
		DMERR("Failed to allocate memory to clear region.");
		return;
	}
	spin_lock_irqsave(&lc->flush_lock, flags);
	fe->type = DM_ULOG_CLEAR_REGION;
	fe->region = region;
	list_add(&fe->list, &lc->flush_list);
	spin_unlock_irqrestore(&lc->flush_lock, flags);
	return;
}