summaryrefslogtreecommitdiff
path: root/libbcachefs/error.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-18 18:21:11 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2022-11-18 18:21:11 -0500
commitc1f55a60c41ca5ab8ed7a0893c3d29f8006da82a (patch)
tree6aed1a472dc723feb6447e5495bc8452e21219f5 /libbcachefs/error.h
parente4716b10ed0210a13efdd3252c12199da3d52aad (diff)
Update bcachefs sources to 6406e05835 bcachefs: Nocow support
Diffstat (limited to 'libbcachefs/error.h')
-rw-r--r--libbcachefs/error.h29
1 files changed, 9 insertions, 20 deletions
diff --git a/libbcachefs/error.h b/libbcachefs/error.h
index bbf9b6d8..dae72620 100644
--- a/libbcachefs/error.h
+++ b/libbcachefs/error.h
@@ -186,36 +186,25 @@ void bch2_io_error_work(struct work_struct *);
/* Does the error handling without logging a message */
void bch2_io_error(struct bch_dev *);
-/* Logs message and handles the error: */
-#define bch2_dev_io_error(ca, fmt, ...) \
-do { \
- printk_ratelimited(KERN_ERR "bcachefs (%s): " fmt, \
- (ca)->name, ##__VA_ARGS__); \
- bch2_io_error(ca); \
-} while (0)
-
-#define bch2_dev_inum_io_error(ca, _inum, _offset, fmt, ...) \
-do { \
- printk_ratelimited(KERN_ERR "bcachefs (%s inum %llu offset %llu): " fmt,\
- (ca)->name, (_inum), (_offset), ##__VA_ARGS__); \
- bch2_io_error(ca); \
-} while (0)
-
#define bch2_dev_io_err_on(cond, ca, ...) \
({ \
bool _ret = (cond); \
\
- if (_ret) \
- bch2_dev_io_error(ca, __VA_ARGS__); \
+ if (_ret) { \
+ bch_err_dev_ratelimited(ca, __VA_ARGS__); \
+ bch2_io_error(ca); \
+ } \
_ret; \
})
-#define bch2_dev_inum_io_err_on(cond, ca, _inum, _offset, ...) \
+#define bch2_dev_inum_io_err_on(cond, ca, ...) \
({ \
bool _ret = (cond); \
\
- if (_ret) \
- bch2_dev_inum_io_error(ca, _inum, _offset, __VA_ARGS__);\
+ if (_ret) { \
+ bch_err_inum_offset_ratelimited(ca, __VA_ARGS__); \
+ bch2_io_error(ca); \
+ } \
_ret; \
})