errcode.c (5c1ef830f6786059f85bebe7501b63dffed0b633) errcode.c (a10195764901e0a41e64d596de57a957e7f982f0)
1// SPDX-License-Identifier: GPL-2.0
2
3#include "bcachefs.h"
4#include "errcode.h"
5
6#include <linux/errname.h>
7
8static const char * const bch2_errcode_strs[] = {

--- 9 unchanged lines hidden (view full) ---

18#define x(class, err) [BCH_ERR_##err - BCH_ERR_START] = class,
19 BCH_ERRCODES()
20#undef x
21};
22
23const char *bch2_err_str(int err)
24{
25 const char *errstr;
1// SPDX-License-Identifier: GPL-2.0
2
3#include "bcachefs.h"
4#include "errcode.h"
5
6#include <linux/errname.h>
7
8static const char * const bch2_errcode_strs[] = {

--- 9 unchanged lines hidden (view full) ---

18#define x(class, err) [BCH_ERR_##err - BCH_ERR_START] = class,
19 BCH_ERRCODES()
20#undef x
21};
22
23const char *bch2_err_str(int err)
24{
25 const char *errstr;
26
26 err = abs(err);
27
28 BUG_ON(err >= BCH_ERR_MAX);
29
30 if (err >= BCH_ERR_START)
31 errstr = bch2_errcode_strs[err - BCH_ERR_START];
32 else if (err)
33 errstr = errname(err);

--- 29 unchanged lines hidden ---
27 err = abs(err);
28
29 BUG_ON(err >= BCH_ERR_MAX);
30
31 if (err >= BCH_ERR_START)
32 errstr = bch2_errcode_strs[err - BCH_ERR_START];
33 else if (err)
34 errstr = errname(err);

--- 29 unchanged lines hidden ---