@@ -261,7 +261,7 @@ static void hib_end_io(struct bio *bio)
261
261
bio_put (bio );
262
262
}
263
263
264
- static int hib_submit_io (int rw , pgoff_t page_off , void * addr ,
264
+ static int hib_submit_io (int op , int op_flags , pgoff_t page_off , void * addr ,
265
265
struct hib_bio_batch * hb )
266
266
{
267
267
struct page * page = virt_to_page (addr );
@@ -271,7 +271,7 @@ static int hib_submit_io(int rw, pgoff_t page_off, void *addr,
271
271
bio = bio_alloc (__GFP_RECLAIM | __GFP_HIGH , 1 );
272
272
bio -> bi_iter .bi_sector = page_off * (PAGE_SIZE >> 9 );
273
273
bio -> bi_bdev = hib_resume_bdev ;
274
- bio -> bi_rw = rw ;
274
+ bio_set_op_attrs ( bio , op , op_flags ) ;
275
275
276
276
if (bio_add_page (bio , page , PAGE_SIZE , 0 ) < PAGE_SIZE ) {
277
277
printk (KERN_ERR "PM: Adding page to bio failed at %llu\n" ,
@@ -307,7 +307,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
307
307
{
308
308
int error ;
309
309
310
- hib_submit_io (READ_SYNC , swsusp_resume_block , swsusp_header , NULL );
310
+ hib_submit_io (REQ_OP_READ , READ_SYNC , swsusp_resume_block ,
311
+ swsusp_header , NULL );
311
312
if (!memcmp ("SWAP-SPACE" ,swsusp_header -> sig , 10 ) ||
312
313
!memcmp ("SWAPSPACE2" ,swsusp_header -> sig , 10 )) {
313
314
memcpy (swsusp_header -> orig_sig ,swsusp_header -> sig , 10 );
@@ -316,8 +317,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
316
317
swsusp_header -> flags = flags ;
317
318
if (flags & SF_CRC32_MODE )
318
319
swsusp_header -> crc32 = handle -> crc32 ;
319
- error = hib_submit_io (WRITE_SYNC , swsusp_resume_block ,
320
- swsusp_header , NULL );
320
+ error = hib_submit_io (REQ_OP_WRITE , WRITE_SYNC ,
321
+ swsusp_resume_block , swsusp_header , NULL );
321
322
} else {
322
323
printk (KERN_ERR "PM: Swap header not found!\n" );
323
324
error = - ENODEV ;
@@ -390,7 +391,7 @@ static int write_page(void *buf, sector_t offset, struct hib_bio_batch *hb)
390
391
} else {
391
392
src = buf ;
392
393
}
393
- return hib_submit_io (WRITE_SYNC , offset , src , hb );
394
+ return hib_submit_io (REQ_OP_WRITE , WRITE_SYNC , offset , src , hb );
394
395
}
395
396
396
397
static void release_swap_writer (struct swap_map_handle * handle )
@@ -993,7 +994,8 @@ static int get_swap_reader(struct swap_map_handle *handle,
993
994
return - ENOMEM ;
994
995
}
995
996
996
- error = hib_submit_io (READ_SYNC , offset , tmp -> map , NULL );
997
+ error = hib_submit_io (REQ_OP_READ , READ_SYNC , offset ,
998
+ tmp -> map , NULL );
997
999
if (error ) {
998
1000
release_swap_reader (handle );
999
1001
return error ;
@@ -1017,7 +1019,7 @@ static int swap_read_page(struct swap_map_handle *handle, void *buf,
1017
1019
offset = handle -> cur -> entries [handle -> k ];
1018
1020
if (!offset )
1019
1021
return - EFAULT ;
1020
- error = hib_submit_io (READ_SYNC , offset , buf , hb );
1022
+ error = hib_submit_io (REQ_OP_READ , READ_SYNC , offset , buf , hb );
1021
1023
if (error )
1022
1024
return error ;
1023
1025
if (++ handle -> k >= MAP_PAGE_ENTRIES ) {
@@ -1526,15 +1528,17 @@ int swsusp_check(void)
1526
1528
if (!IS_ERR (hib_resume_bdev )) {
1527
1529
set_blocksize (hib_resume_bdev , PAGE_SIZE );
1528
1530
clear_page (swsusp_header );
1529
- error = hib_submit_io (READ_SYNC , swsusp_resume_block ,
1531
+ error = hib_submit_io (REQ_OP_READ , READ_SYNC ,
1532
+ swsusp_resume_block ,
1530
1533
swsusp_header , NULL );
1531
1534
if (error )
1532
1535
goto put ;
1533
1536
1534
1537
if (!memcmp (HIBERNATE_SIG , swsusp_header -> sig , 10 )) {
1535
1538
memcpy (swsusp_header -> sig , swsusp_header -> orig_sig , 10 );
1536
1539
/* Reset swap signature now */
1537
- error = hib_submit_io (WRITE_SYNC , swsusp_resume_block ,
1540
+ error = hib_submit_io (REQ_OP_WRITE , WRITE_SYNC ,
1541
+ swsusp_resume_block ,
1538
1542
swsusp_header , NULL );
1539
1543
} else {
1540
1544
error = - EINVAL ;
@@ -1578,10 +1582,12 @@ int swsusp_unmark(void)
1578
1582
{
1579
1583
int error ;
1580
1584
1581
- hib_submit_io (READ_SYNC , swsusp_resume_block , swsusp_header , NULL );
1585
+ hib_submit_io (REQ_OP_READ , READ_SYNC , swsusp_resume_block ,
1586
+ swsusp_header , NULL );
1582
1587
if (!memcmp (HIBERNATE_SIG ,swsusp_header -> sig , 10 )) {
1583
1588
memcpy (swsusp_header -> sig ,swsusp_header -> orig_sig , 10 );
1584
- error = hib_submit_io (WRITE_SYNC , swsusp_resume_block ,
1589
+ error = hib_submit_io (REQ_OP_WRITE , WRITE_SYNC ,
1590
+ swsusp_resume_block ,
1585
1591
swsusp_header , NULL );
1586
1592
} else {
1587
1593
printk (KERN_ERR "PM: Cannot find swsusp signature!\n" );
0 commit comments