]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - linux/bio.c
Merge pull request #38 from jnsaff/patch-1
[bcachefs-tools-debian] / linux / bio.c
index 797204f81fb2b960387baa9ed1b424c8f220d050..8422c2625dec5a82e0dc4cce1afd72386fec896d 100644 (file)
@@ -52,6 +52,15 @@ int blk_status_to_errno(blk_status_t status)
        return blk_errors[idx].err;
 }
 
+const char *blk_status_to_str(blk_status_t status)
+{
+       int idx = (__force int)status;
+
+       if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
+               return "(invalid error)";
+       return blk_errors[idx].name;
+}
+
 void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter,
                        struct bio *src, struct bvec_iter *src_iter)
 {