]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/errcode.c
Update bcachefs sources to 2a6125decb43 bcachefs: bch_sb_field_downgrade
[bcachefs-tools-debian] / libbcachefs / errcode.c
index cc9ce0be356e20931a44df8e6a0ce0944be799a0..d260ff9bbfeb7b9121f222a4362f37f95c927977 100644 (file)
@@ -12,8 +12,6 @@ static const char * const bch2_errcode_strs[] = {
        NULL
 };
 
-#define BCH_ERR_0      0
-
 static unsigned bch2_errcode_parents[] = {
 #define x(class, err) [BCH_ERR_##err - BCH_ERR_START] = class,
        BCH_ERRCODES()
@@ -23,6 +21,7 @@ static unsigned bch2_errcode_parents[] = {
 const char *bch2_err_str(int err)
 {
        const char *errstr;
+
        err = abs(err);
 
        BUG_ON(err >= BCH_ERR_MAX);
@@ -60,3 +59,10 @@ int __bch2_err_class(int err)
 
        return -err;
 }
+
+const char *bch2_blk_status_to_str(blk_status_t status)
+{
+       if (status == BLK_STS_REMOVED)
+               return "device removed";
+       return blk_status_to_str(status);
+}