@@ -806,12 +806,14 @@ void dm_table_set_type(struct dm_table *t, enum dm_queue_mode type)
806806EXPORT_SYMBOL_GPL (dm_table_set_type );
807807
808808/* validate the dax capability of the target device span */
809- int device_not_dax_capable (struct dm_target * ti , struct dm_dev * dev ,
809+ static int device_not_dax_capable (struct dm_target * ti , struct dm_dev * dev ,
810810 sector_t start , sector_t len , void * data )
811811{
812- int blocksize = * (int * ) data ;
812+ if (dev -> dax_dev )
813+ return false;
813814
814- return !dax_supported (dev -> dax_dev , dev -> bdev , blocksize , start , len );
815+ DMDEBUG ("%pg: error: dax unsupported by block device" , dev -> bdev );
816+ return true;
815817}
816818
817819/* Check devices support synchronous DAX */
@@ -821,8 +823,8 @@ static int device_not_dax_synchronous_capable(struct dm_target *ti, struct dm_de
821823 return !dev -> dax_dev || !dax_synchronous (dev -> dax_dev );
822824}
823825
824- bool dm_table_supports_dax (struct dm_table * t ,
825- iterate_devices_callout_fn iterate_fn , int * blocksize )
826+ static bool dm_table_supports_dax (struct dm_table * t ,
827+ iterate_devices_callout_fn iterate_fn )
826828{
827829 struct dm_target * ti ;
828830 unsigned i ;
@@ -835,7 +837,7 @@ bool dm_table_supports_dax(struct dm_table *t,
835837 return false;
836838
837839 if (!ti -> type -> iterate_devices ||
838- ti -> type -> iterate_devices (ti , iterate_fn , blocksize ))
840+ ti -> type -> iterate_devices (ti , iterate_fn , NULL ))
839841 return false;
840842 }
841843
@@ -862,7 +864,6 @@ static int dm_table_determine_type(struct dm_table *t)
862864 struct dm_target * tgt ;
863865 struct list_head * devices = dm_table_get_devices (t );
864866 enum dm_queue_mode live_md_type = dm_get_md_type (t -> md );
865- int page_size = PAGE_SIZE ;
866867
867868 if (t -> type != DM_TYPE_NONE ) {
868869 /* target already set the table's type */
@@ -906,7 +907,7 @@ static int dm_table_determine_type(struct dm_table *t)
906907verify_bio_based :
907908 /* We must use this table as bio-based */
908909 t -> type = DM_TYPE_BIO_BASED ;
909- if (dm_table_supports_dax (t , device_not_dax_capable , & page_size ) ||
910+ if (dm_table_supports_dax (t , device_not_dax_capable ) ||
910911 (list_empty (devices ) && live_md_type == DM_TYPE_DAX_BIO_BASED )) {
911912 t -> type = DM_TYPE_DAX_BIO_BASED ;
912913 }
@@ -1976,7 +1977,6 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
19761977 struct queue_limits * limits )
19771978{
19781979 bool wc = false, fua = false;
1979- int page_size = PAGE_SIZE ;
19801980 int r ;
19811981
19821982 /*
@@ -2010,9 +2010,9 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
20102010 }
20112011 blk_queue_write_cache (q , wc , fua );
20122012
2013- if (dm_table_supports_dax (t , device_not_dax_capable , & page_size )) {
2013+ if (dm_table_supports_dax (t , device_not_dax_capable )) {
20142014 blk_queue_flag_set (QUEUE_FLAG_DAX , q );
2015- if (dm_table_supports_dax (t , device_not_dax_synchronous_capable , NULL ))
2015+ if (dm_table_supports_dax (t , device_not_dax_synchronous_capable ))
20162016 set_dax_synchronous (t -> md -> dax_dev );
20172017 }
20182018 else
0 commit comments