Commit Message

From: Anand Jain <Anand.Jain@oracle.com>
This patch provides helper functions to force a device to offline
or failed, and we need this device states for the following reasons,
1) a. it can be reported that device has failed when it does
b. close the device when it goes offline so that blocklayer can
cleanup
2) identify the candidate for the auto replace
3) avoid further commit error reported against the failing device and
4) a device in the multi device btrfs may go offline from the system
(but as of now in in some system config btrfs gets unmounted in this
context, which is not a correct behavior)
Signed-off-by: Anand Jain <anand.jain@oracle.com>Tested-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
---
fs/btrfs/volumes.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++
fs/btrfs/volumes.h | 14 ++++++
2 files changed, 152 insertions(+)