@@ -305,7 +305,7 @@ static void km_dp_init(struct dpages *dp, void *data)
305305 */
306306static void do_region (const blk_opf_t opf , unsigned int region ,
307307 struct dm_io_region * where , struct dpages * dp ,
308- struct io * io )
308+ struct io * io , unsigned short ioprio )
309309{
310310 struct bio * bio ;
311311 struct page * page ;
@@ -354,6 +354,7 @@ static void do_region(const blk_opf_t opf, unsigned int region,
354354 & io -> client -> bios );
355355 bio -> bi_iter .bi_sector = where -> sector + (where -> count - remaining );
356356 bio -> bi_end_io = endio ;
357+ bio -> bi_ioprio = ioprio ;
357358 store_io_and_region_in_bio (bio , io , region );
358359
359360 if (op == REQ_OP_DISCARD || op == REQ_OP_WRITE_ZEROES ) {
@@ -383,7 +384,7 @@ static void do_region(const blk_opf_t opf, unsigned int region,
383384
384385static void dispatch_io (blk_opf_t opf , unsigned int num_regions ,
385386 struct dm_io_region * where , struct dpages * dp ,
386- struct io * io , int sync )
387+ struct io * io , int sync , unsigned short ioprio )
387388{
388389 int i ;
389390 struct dpages old_pages = * dp ;
@@ -400,7 +401,7 @@ static void dispatch_io(blk_opf_t opf, unsigned int num_regions,
400401 for (i = 0 ; i < num_regions ; i ++ ) {
401402 * dp = old_pages ;
402403 if (where [i ].count || (opf & REQ_PREFLUSH ))
403- do_region (opf , i , where + i , dp , io );
404+ do_region (opf , i , where + i , dp , io , ioprio );
404405 }
405406
406407 /*
@@ -425,7 +426,7 @@ static void sync_io_complete(unsigned long error, void *context)
425426
426427static int sync_io (struct dm_io_client * client , unsigned int num_regions ,
427428 struct dm_io_region * where , blk_opf_t opf , struct dpages * dp ,
428- unsigned long * error_bits )
429+ unsigned long * error_bits , unsigned short ioprio )
429430{
430431 struct io * io ;
431432 struct sync_io sio ;
@@ -447,7 +448,7 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
447448 io -> vma_invalidate_address = dp -> vma_invalidate_address ;
448449 io -> vma_invalidate_size = dp -> vma_invalidate_size ;
449450
450- dispatch_io (opf , num_regions , where , dp , io , 1 );
451+ dispatch_io (opf , num_regions , where , dp , io , 1 , ioprio );
451452
452453 wait_for_completion_io (& sio .wait );
453454
@@ -459,7 +460,8 @@ static int sync_io(struct dm_io_client *client, unsigned int num_regions,
459460
460461static int async_io (struct dm_io_client * client , unsigned int num_regions ,
461462 struct dm_io_region * where , blk_opf_t opf ,
462- struct dpages * dp , io_notify_fn fn , void * context )
463+ struct dpages * dp , io_notify_fn fn , void * context ,
464+ unsigned short ioprio )
463465{
464466 struct io * io ;
465467
@@ -479,7 +481,7 @@ static int async_io(struct dm_io_client *client, unsigned int num_regions,
479481 io -> vma_invalidate_address = dp -> vma_invalidate_address ;
480482 io -> vma_invalidate_size = dp -> vma_invalidate_size ;
481483
482- dispatch_io (opf , num_regions , where , dp , io , 0 );
484+ dispatch_io (opf , num_regions , where , dp , io , 0 , ioprio );
483485 return 0 ;
484486}
485487
@@ -521,7 +523,8 @@ static int dp_init(struct dm_io_request *io_req, struct dpages *dp,
521523}
522524
523525int dm_io (struct dm_io_request * io_req , unsigned int num_regions ,
524- struct dm_io_region * where , unsigned long * sync_error_bits )
526+ struct dm_io_region * where , unsigned long * sync_error_bits ,
527+ unsigned short ioprio )
525528{
526529 int r ;
527530 struct dpages dp ;
@@ -532,11 +535,11 @@ int dm_io(struct dm_io_request *io_req, unsigned int num_regions,
532535
533536 if (!io_req -> notify .fn )
534537 return sync_io (io_req -> client , num_regions , where ,
535- io_req -> bi_opf , & dp , sync_error_bits );
538+ io_req -> bi_opf , & dp , sync_error_bits , ioprio );
536539
537540 return async_io (io_req -> client , num_regions , where ,
538541 io_req -> bi_opf , & dp , io_req -> notify .fn ,
539- io_req -> notify .context );
542+ io_req -> notify .context , ioprio );
540543}
541544EXPORT_SYMBOL (dm_io );
542545
0 commit comments