dm: set QUEUE_FLAG_DAX accordingly in dm_table_set_restrictions()
authorMike Snitzer <snitzer@redhat.com>
Tue, 5 Dec 2017 04:28:32 +0000 (23:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2018 14:29:23 +0000 (16:29 +0200)
commit ad3793fc3945173f64d82d05d3ecde41f6c0435c upstream.

Rather than having DAX support be unique by setting it based on table
type in dm_setup_md_queue().

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-table.c
drivers/md/dm.c

index 4287fc9f3527f84cf4606b795be92d63503534dc..94849435c4873c4cdf6186543b51c7f22e946cdf 100644 (file)
@@ -1813,6 +1813,8 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
        }
        blk_queue_write_cache(q, wc, fua);
 
+       if (dm_table_supports_dax(t))
+               queue_flag_set_unlocked(QUEUE_FLAG_DAX, q);
        if (dm_table_supports_dax_write_cache(t))
                dax_write_cache(t->md->dax_dev, true);
 
index 1dfc855ac7085b0628195d52bdd76475e9e68200..b721f0a167110a132981ae092aee93fffcdca774 100644 (file)
@@ -2050,9 +2050,6 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t)
                 */
                bioset_free(md->queue->bio_split);
                md->queue->bio_split = NULL;
-
-               if (type == DM_TYPE_DAX_BIO_BASED)
-                       queue_flag_set_unlocked(QUEUE_FLAG_DAX, md->queue);
                break;
        case DM_TYPE_NONE:
                WARN_ON_ONCE(true);