btrfs: factor btrfs_check_rw_degradable() to check given device
commit6528b99d3d20795ff947d9b3fd736affe901acef
authorAnand Jain <Anand.Jain@oracle.com>
Mon, 18 Dec 2017 09:08:59 +0000 (18 17:08 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:20 +0000 (22 16:08 +0100)
treee184957907d6a57cd0c1b53e193e07b9e39ea352
parente43bbe5e16d87b40f3b382b3a43b0142d6d1193d
btrfs: factor btrfs_check_rw_degradable() to check given device

Update btrfs_check_rw_degradable() to check against the given device if
its lost.

We can use this function to know if the volume is going to be in
degraded mode OR failed state, when the given device fails.  Which is
needed when we are handling the device failed state.

A preparatory patch does not affect the flow as such.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
[ enhance comment ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/super.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h