btrfs: cleanup assigning next active device with a check

Creates helper fucntion as needed by the device delete
and replace operations. Also now it checks if the next
device being assigned is an active device.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Anand Jain 2016-05-03 17:44:43 +08:00 • committed by David Sterba
commit 88acff64c6
3 changed files with 48 additions and 22 deletions