dm: add dm_deleting_md function