Skip to content

Commit

Permalink
scatterlist: do not disable IRQs in sg_copy_buffer
Browse files Browse the repository at this point in the history
Commit 50bed2e ("sg: disable interrupts inside sg_copy_buffer")
introduced disabling interrupts in sg_copy_buffer() since atomic uses of
miter required it due to use of kmap_atomic().

However, as commit 8290e2d ("scatterlist: atomic sg_mapping_iter()
no longer needs disabled IRQs") acknowledges disabling interrupts is no
longer needed for calls to kmap_atomic() and therefore unneeded for
miter ops either, so remove it from sg_copy_buffer().

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gby authored and torvalds committed Feb 28, 2017
1 parent 1d5210e commit d317120
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/scatterlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
{
unsigned int offset = 0;
struct sg_mapping_iter miter;
unsigned long flags;
unsigned int sg_flags = SG_MITER_ATOMIC;

if (to_buffer)
Expand All @@ -664,8 +663,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
if (!sg_miter_skip(&miter, skip))
return false;

local_irq_save(flags);

while ((offset < buflen) && sg_miter_next(&miter)) {
unsigned int len;

Expand All @@ -681,7 +678,6 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,

sg_miter_stop(&miter);

local_irq_restore(flags);
return offset;
}
EXPORT_SYMBOL(sg_copy_buffer);
Expand Down

0 comments on commit d317120

Please sign in to comment.