Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm: use dm_table_get_device_name() where appropriate in targets

dm_table_get_device_name() avoids calling dm_table_get_md() followed by
dm_device_name() -- saves intermediate dm_table_get_md() call.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>

+8 -10
+1 -1
drivers/md/dm-cache-target.c
··· 925 925 926 926 static const char *cache_device_name(struct cache *cache) 927 927 { 928 - return dm_device_name(dm_table_get_md(cache->ti->table)); 928 + return dm_table_device_name(cache->ti->table); 929 929 } 930 930 931 931 static void notify_mode_switch(struct cache *cache, enum cache_metadata_mode mode)
+7 -9
drivers/md/dm-mpath.c
··· 466 466 */ 467 467 #define dm_report_EIO(m) \ 468 468 do { \ 469 - struct mapped_device *md = dm_table_get_md((m)->ti->table); \ 470 - \ 471 469 DMDEBUG_LIMIT("%s: returning EIO; QIFNP = %d; SQIFNP = %d; DNFS = %d", \ 472 - dm_device_name(md), \ 470 + dm_table_device_name((m)->ti->table), \ 473 471 test_bit(MPATHF_QUEUE_IF_NO_PATH, &(m)->flags), \ 474 472 test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &(m)->flags), \ 475 473 dm_noflush_suspending((m)->ti)); \ ··· 734 736 { 735 737 unsigned long flags; 736 738 bool queue_if_no_path_bit, saved_queue_if_no_path_bit; 737 - const char *dm_dev_name = dm_device_name(dm_table_get_md(m->ti->table)); 739 + const char *dm_dev_name = dm_table_device_name(m->ti->table); 738 740 739 741 DMDEBUG("%s: %s caller=%s queue_if_no_path=%d save_old_value=%d", 740 742 dm_dev_name, __func__, caller, queue_if_no_path, save_old_value); ··· 779 781 static void queue_if_no_path_timeout_work(struct timer_list *t) 780 782 { 781 783 struct multipath *m = from_timer(m, t, nopath_timer); 782 - struct mapped_device *md = dm_table_get_md(m->ti->table); 783 784 784 - DMWARN("queue_if_no_path timeout on %s, failing queued IO", dm_device_name(md)); 785 + DMWARN("queue_if_no_path timeout on %s, failing queued IO", 786 + dm_table_device_name(m->ti->table)); 785 787 queue_if_no_path(m, false, false, __func__); 786 788 } 787 789 ··· 1332 1334 goto out; 1333 1335 1334 1336 DMWARN("%s: Failing path %s.", 1335 - dm_device_name(dm_table_get_md(m->ti->table)), 1337 + dm_table_device_name(m->ti->table), 1336 1338 pgpath->path.dev->name); 1337 1339 1338 1340 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); ··· 1373 1375 goto out; 1374 1376 1375 1377 DMWARN("%s: Reinstating path %s.", 1376 - dm_device_name(dm_table_get_md(m->ti->table)), 1378 + dm_table_device_name(m->ti->table), 1377 1379 pgpath->path.dev->name); 1378 1380 1379 1381 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); ··· 1764 1766 } 1765 1767 1766 1768 DMDEBUG("%s: %s finished; QIFNP = %d; SQIFNP = %d", 1767 - dm_device_name(dm_table_get_md(m->ti->table)), __func__, 1769 + dm_table_device_name(m->ti->table), __func__, 1768 1770 test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags), 1769 1771 test_bit(MPATHF_SAVED_QUEUE_IF_NO_PATH, &m->flags)); 1770 1772