summaryrefslogtreecommitdiff
path: root/libbcachefs/errcode.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-29 19:54:39 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-29 20:18:40 -0400
commit4613023c166e95bd37eef957a82080b2c7625d0d (patch)
treea48047c93ed9d1fc2d2b41c1947ce3fa2762fdf1 /libbcachefs/errcode.c
parentadb8bdd53d7ab156aebebb39c875c4ce19a622ac (diff)
Update bcachefs sources to 7f938192650f bcachefs: darray_find(), darray_find_p()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/errcode.c')
-rw-r--r--libbcachefs/errcode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbcachefs/errcode.c b/libbcachefs/errcode.c
index 43557beb..c39cf304 100644
--- a/libbcachefs/errcode.c
+++ b/libbcachefs/errcode.c
@@ -13,12 +13,13 @@ static const char * const bch2_errcode_strs[] = {
NULL
};
-static unsigned bch2_errcode_parents[] = {
+static const unsigned bch2_errcode_parents[] = {
#define x(class, err) [BCH_ERR_##err - BCH_ERR_START] = class,
BCH_ERRCODES()
#undef x
};
+__attribute__((const))
const char *bch2_err_str(int err)
{
const char *errstr;
@@ -36,6 +37,7 @@ const char *bch2_err_str(int err)
return errstr ?: "(Invalid error)";
}
+__attribute__((const))
bool __bch2_err_matches(int err, int class)
{
err = abs(err);