summaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index f80fd33639e0..57d22571f306 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -225,14 +225,14 @@ static struct block_device *hib_resume_bdev;
225struct hib_bio_batch { 225struct hib_bio_batch {
226 atomic_t count; 226 atomic_t count;
227 wait_queue_head_t wait; 227 wait_queue_head_t wait;
228 int error; 228 blk_status_t error;
229}; 229};
230 230
231static void hib_init_batch(struct hib_bio_batch *hb) 231static void hib_init_batch(struct hib_bio_batch *hb)
232{ 232{
233 atomic_set(&hb->count, 0); 233 atomic_set(&hb->count, 0);
234 init_waitqueue_head(&hb->wait); 234 init_waitqueue_head(&hb->wait);
235 hb->error = 0; 235 hb->error = BLK_STS_OK;
236} 236}
237 237
238static void hib_end_io(struct bio *bio) 238static void hib_end_io(struct bio *bio)
@@ -240,7 +240,7 @@ static void hib_end_io(struct bio *bio)
240 struct hib_bio_batch *hb = bio->bi_private; 240 struct hib_bio_batch *hb = bio->bi_private;
241 struct page *page = bio->bi_io_vec[0].bv_page; 241 struct page *page = bio->bi_io_vec[0].bv_page;
242 242
243 if (bio->bi_error) { 243 if (bio->bi_status) {
244 printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n", 244 printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n",
245 imajor(bio->bi_bdev->bd_inode), 245 imajor(bio->bi_bdev->bd_inode),
246 iminor(bio->bi_bdev->bd_inode), 246 iminor(bio->bi_bdev->bd_inode),
@@ -253,8 +253,8 @@ static void hib_end_io(struct bio *bio)
253 flush_icache_range((unsigned long)page_address(page), 253 flush_icache_range((unsigned long)page_address(page),
254 (unsigned long)page_address(page) + PAGE_SIZE); 254 (unsigned long)page_address(page) + PAGE_SIZE);
255 255
256 if (bio->bi_error && !hb->error) 256 if (bio->bi_status && !hb->error)
257 hb->error = bio->bi_error; 257 hb->error = bio->bi_status;
258 if (atomic_dec_and_test(&hb->count)) 258 if (atomic_dec_and_test(&hb->count))
259 wake_up(&hb->wait); 259 wake_up(&hb->wait);
260 260
@@ -293,10 +293,10 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr,
293 return error; 293 return error;
294} 294}
295 295
296static int hib_wait_io(struct hib_bio_batch *hb) 296static blk_status_t hib_wait_io(struct hib_bio_batch *hb)
297{ 297{
298 wait_event(hb->wait, atomic_read(&hb->count) == 0); 298 wait_event(hb->wait, atomic_read(&hb->count) == 0);
299 return hb->error; 299 return blk_status_to_errno(hb->error);
300} 300}
301 301
302/* 302/*