sys/dev/disk/dm: Fix device counter handling
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 10 Nov 2015 12:57:14 +0000 (21:57 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 12 Nov 2015 14:33:50 +0000 (23:33 +0900)
commit3472ce2b8a1bca797802d433bbd411a9aa5f7ac2
treec21a31c93c7bac68d5c3bd32cef01fe2a1927a6d
parenta6b470c8dd8f2636821a0158478eb060535770f1
sys/dev/disk/dm: Fix device counter handling

dm_dev_list and its element counter dm_dev_counter should be
protected by the same lock dm_dev_mutex. Having these updated
separately makes code logic more complex than it should.

If dm_dev_counter is protected by dm_dev_mutex, then no need
to care if dm_dev_counter++/-- are atomic or not.
sys/dev/disk/dm/dm_dev.c