/* Context: IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.  */
void sg_miter_stop(struct sg_mapping_iter *miter)
/* Context: IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise.  */
void sg_miter_stop(struct sg_mapping_iter *miter)
{
	WARN_ON(miter->consumed > miter->length);
	if (miter->addr) {
		miter->__offset += miter->consumed;
		if (miter->__flags & SG_MITER_TO_SG)
			flush_kernel_dcache_page(miter->page);
		if (miter->__flags & SG_MITER_ATOMIC) {
			WARN_ON(!irqs_disabled());
			kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
		} else
			kunmap(miter->page);
		miter->page = NULL;
		miter->addr = NULL;
		miter->length = 0;
		miter->consumed = 0;
	}
}