Commit 01fce686 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dm: Remove redundant spin lock in dec_pending()

From: Joe Thornber <thornber@redhat.com>

Remove redundant spin lock in dec_pending()
parent bc553993
...@@ -217,14 +217,8 @@ static int queue_io(struct mapped_device *md, struct bio *bio) ...@@ -217,14 +217,8 @@ static int queue_io(struct mapped_device *md, struct bio *bio)
*/ */
static inline void dec_pending(struct dm_io *io, int error) static inline void dec_pending(struct dm_io *io, int error)
{ {
static spinlock_t _uptodate_lock = SPIN_LOCK_UNLOCKED; if (error)
unsigned long flags;
if (error) {
spin_lock_irqsave(&_uptodate_lock, flags);
io->error = error; io->error = error;
spin_unlock_irqrestore(&_uptodate_lock, flags);
}
if (atomic_dec_and_test(&io->io_count)) { if (atomic_dec_and_test(&io->io_count)) {
if (atomic_dec_and_test(&io->md->pending)) if (atomic_dec_and_test(&io->md->pending))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment