[prev in list] [next in list] [prev in thread] [next in thread]
List: dm-devel
Subject: [dm-devel] [PATCH 5.20 2/4] dm: add new helper for handling dm_io requeue
From: Ming Lei <ming.lei () redhat ! com>
Date: 2022-06-24 14:12:53
Message-ID: 20220624141255.2461148-3-ming.lei () redhat ! com
[Download RAW message or body]
Add helper of dm_handle_requeue() for handling dm_io requeue.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
drivers/md/dm.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 2b75f1ef7386..a9e5e429c150 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -884,13 +884,11 @@ static int __noflush_suspending(struct mapped_device *md)
return test_bit(DMF_NOFLUSH_SUSPENDING, &md->flags);
}
-static void dm_io_complete(struct dm_io *io)
+static void dm_handle_requeue(struct dm_io *io)
{
- blk_status_t io_error;
- struct mapped_device *md = io->md;
- struct bio *bio = io->split_bio ? io->split_bio : io->orig_bio;
-
if (io->status == BLK_STS_DM_REQUEUE) {
+ struct bio *bio = io->split_bio ? io->split_bio : io->orig_bio;
+ struct mapped_device *md = io->md;
unsigned long flags;
/*
* Target requested pushing back the I/O.
@@ -909,6 +907,15 @@ static void dm_io_complete(struct dm_io *io)
}
spin_unlock_irqrestore(&md->deferred_lock, flags);
}
+}
+
+static void dm_io_complete(struct dm_io *io)
+{
+ struct bio *bio = io->split_bio ? io->split_bio : io->orig_bio;
+ struct mapped_device *md = io->md;
+ blk_status_t io_error;
+
+ dm_handle_requeue(io);
io_error = io->status;
if (dm_io_flagged(io, DM_IO_ACCOUNTED))
--
2.31.1
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic