summaryrefslogtreecommitdiff
path: root/kernel/power/tuxonice_bio_core.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-12-15 14:52:16 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-12-15 14:52:16 -0300
commit8d91c1e411f55d7ea91b1183a2e9f8088fb4d5be (patch)
treee9891aa6c295060d065adffd610c4f49ecf884f3 /kernel/power/tuxonice_bio_core.c
parenta71852147516bc1cb5b0b3cbd13639bfd4022dc8 (diff)
Linux-libre 4.3.2-gnu
Diffstat (limited to 'kernel/power/tuxonice_bio_core.c')
-rw-r--r--kernel/power/tuxonice_bio_core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/power/tuxonice_bio_core.c b/kernel/power/tuxonice_bio_core.c
index 193e1532e..87aa4c96e 100644
--- a/kernel/power/tuxonice_bio_core.c
+++ b/kernel/power/tuxonice_bio_core.c
@@ -305,7 +305,6 @@ static int toi_finish_all_io(void)
/**
* toi_end_bio - bio completion function.
* @bio: bio that has completed.
- * @err: Error value. Yes, like end_swap_bio_read, we ignore it.
*
* Function called by the block driver from interrupt context when I/O is
* completed. If we were writing the page, we want to free it and will have
@@ -314,11 +313,11 @@ static int toi_finish_all_io(void)
* reading the page, it will be in the singly linked list made from
* page->private pointers.
**/
-static void toi_end_bio(struct bio *bio, int err)
+static void toi_end_bio(struct bio *bio)
{
struct page *page = bio->bi_io_vec[0].bv_page;
- BUG_ON(!test_bit(BIO_UPTODATE, &bio->bi_flags));
+ BUG_ON(bio->bi_error);
unlock_page(page);
bio_put(bio);
@@ -385,7 +384,7 @@ static int submit(int writing, struct block_device *dev, sector_t first_block,
bio->bi_iter.bi_sector = first_block;
bio->bi_private = (void *) ((unsigned long) free_group);
bio->bi_end_io = toi_end_bio;
- bio->bi_flags |= (1 << BIO_TOI);
+ bio_set_flag(bio, BIO_TOI);
if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
printk(KERN_DEBUG "ERROR: adding page to bio at %lld\n",
@@ -408,8 +407,8 @@ static int submit(int writing, struct block_device *dev, sector_t first_block,
/* Still read the header! */
if (unlikely(test_action_state(TOI_TEST_BIO) && writing)) {
/* Fake having done the hard work */
- set_bit(BIO_UPTODATE, &bio->bi_flags);
- toi_end_bio(bio, 0);
+ bio->bi_error = 0;
+ toi_end_bio(bio);
} else
submit_bio(writing | REQ_SYNC, bio);