aboutsummaryrefslogtreecommitdiffstats
path: root/lib/scatterlist.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-10-04 20:13:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:04:58 -0400
commit8290e2d2dcbf0d379d4b1379e17916515ee20a39 (patch)
treeb52a1e54446331aff7233ecdefdb8af479b33f5d /lib/scatterlist.c
parent17d7aac9a55b164874f3d4b7b4f5af87ab457b84 (diff)
scatterlist: atomic sg_mapping_iter() no longer needs disabled IRQs
SG mapping iterator w/ SG_MITER_ATOMIC set required IRQ disabled because it originally used KM_BIO_SRC_IRQ to allow use from IRQ handlers. kmap_atomic() has long been updated to handle stacking atomic mapping requests on per-cpu basis and only requires not sleeping while mapped. Update sg_mapping_iter such that atomic iterators only require disabling preemption instead of disabling IRQ. While at it, convert wte weird @ARG@ notations to @ARG in the comment of sg_miter_start(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Alex Dubov <oakad@yahoo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/scatterlist.c')
-rw-r--r--lib/scatterlist.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index fadae774a20c..e76d85cf3175 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -404,14 +404,13 @@ EXPORT_SYMBOL(sg_miter_start);
404 * @miter: sg mapping iter to proceed 404 * @miter: sg mapping iter to proceed
405 * 405 *
406 * Description: 406 * Description:
407 * Proceeds @miter@ to the next mapping. @miter@ should have been 407 * Proceeds @miter to the next mapping. @miter should have been started
408 * started using sg_miter_start(). On successful return, 408 * using sg_miter_start(). On successful return, @miter->page,
409 * @miter@->page, @miter@->addr and @miter@->length point to the 409 * @miter->addr and @miter->length point to the current mapping.
410 * current mapping.
411 * 410 *
412 * Context: 411 * Context:
413 * IRQ disabled if SG_MITER_ATOMIC. IRQ must stay disabled till 412 * Preemption disabled if SG_MITER_ATOMIC. Preemption must stay disabled
414 * @miter@ is stopped. May sleep if !SG_MITER_ATOMIC. 413 * till @miter is stopped. May sleep if !SG_MITER_ATOMIC.
415 * 414 *
416 * Returns: 415 * Returns:
417 * true if @miter contains the next mapping. false if end of sg 416 * true if @miter contains the next mapping. false if end of sg
@@ -465,7 +464,8 @@ EXPORT_SYMBOL(sg_miter_next);
465 * resources (kmap) need to be released during iteration. 464 * resources (kmap) need to be released during iteration.
466 * 465 *
467 * Context: 466 * Context:
468 * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. 467 * Preemption disabled if the SG_MITER_ATOMIC is set. Don't care
468 * otherwise.
469 */ 469 */
470void sg_miter_stop(struct sg_mapping_iter *miter) 470void sg_miter_stop(struct sg_mapping_iter *miter)
471{ 471{
@@ -479,7 +479,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
479 flush_kernel_dcache_page(miter->page); 479 flush_kernel_dcache_page(miter->page);
480 480
481 if (miter->__flags & SG_MITER_ATOMIC) { 481 if (miter->__flags & SG_MITER_ATOMIC) {
482 WARN_ON(!irqs_disabled()); 482 WARN_ON_ONCE(preemptible());
483 kunmap_atomic(miter->addr); 483 kunmap_atomic(miter->addr);
484 } else 484 } else
485 kunmap(miter->page); 485 kunmap(miter->page);