X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libbcachefs%2Ferrcode.c;h=d260ff9bbfeb7b9121f222a4362f37f95c927977;hb=3798bbae98cb82e13df18ddf095488b98afe0ddd;hp=dc906fc9176fecf9f8a7240ff78780a742367735;hpb=56c5542c969adbad6bcce80323ff4618c26f83a9;p=bcachefs-tools-debian diff --git a/libbcachefs/errcode.c b/libbcachefs/errcode.c index dc906fc..d260ff9 100644 --- a/libbcachefs/errcode.c +++ b/libbcachefs/errcode.c @@ -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() @@ -61,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); +}