@@ -4327,10 +4327,9 @@ static inline void assfail(char *expr, char *file, int line)
4327
4327
#define ASSERT (expr ) ((void)0)
4328
4328
#endif
4329
4329
4330
- #define btrfs_assert ()
4331
4330
__printf (5 , 6 )
4332
4331
__cold
4333
- void __btrfs_std_error (struct btrfs_fs_info * fs_info , const char * function ,
4332
+ void __btrfs_handle_fs_error (struct btrfs_fs_info * fs_info , const char * function ,
4334
4333
unsigned int line , int errno , const char * fmt , ...);
4335
4334
4336
4335
const char * btrfs_decode_error (int errno );
@@ -4340,6 +4339,46 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
4340
4339
struct btrfs_root * root , const char * function ,
4341
4340
unsigned int line , int errno );
4342
4341
4342
+ /*
4343
+ * Call btrfs_abort_transaction as early as possible when an error condition is
4344
+ * detected, that way the exact line number is reported.
4345
+ */
4346
+ #define btrfs_abort_transaction (trans , root , errno ) \
4347
+ do { \
4348
+ /* Report first abort since mount */ \
4349
+ if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
4350
+ &((root)->fs_info->fs_state))) { \
4351
+ WARN(1, KERN_DEBUG \
4352
+ "BTRFS: Transaction aborted (error %d)\n", \
4353
+ (errno)); \
4354
+ } \
4355
+ __btrfs_abort_transaction((trans), (root), __func__, \
4356
+ __LINE__, (errno)); \
4357
+ } while (0)
4358
+
4359
+ #define btrfs_handle_fs_error (fs_info , errno , fmt , args ...) \
4360
+ do { \
4361
+ __btrfs_handle_fs_error((fs_info), __func__, __LINE__, \
4362
+ (errno), fmt, ##args); \
4363
+ } while (0)
4364
+
4365
+ __printf (5 , 6 )
4366
+ __cold
4367
+ void __btrfs_panic (struct btrfs_fs_info * fs_info , const char * function ,
4368
+ unsigned int line , int errno , const char * fmt , ...);
4369
+ /*
4370
+ * If BTRFS_MOUNT_PANIC_ON_FATAL_ERROR is in mount_opt, __btrfs_panic
4371
+ * will panic(). Otherwise we BUG() here.
4372
+ */
4373
+ #define btrfs_panic (fs_info , errno , fmt , args ...) \
4374
+ do { \
4375
+ __btrfs_panic(fs_info, __func__, __LINE__, errno, fmt, ##args); \
4376
+ BUG(); \
4377
+ } while (0)
4378
+
4379
+
4380
+ /* compatibility and incompatibility defines */
4381
+
4343
4382
#define btrfs_set_fs_incompat (__fs_info , opt ) \
4344
4383
__btrfs_set_fs_incompat((__fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
4345
4384
@@ -4456,44 +4495,6 @@ static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
4456
4495
return !!(btrfs_super_compat_ro_flags (disk_super ) & flag );
4457
4496
}
4458
4497
4459
- /*
4460
- * Call btrfs_abort_transaction as early as possible when an error condition is
4461
- * detected, that way the exact line number is reported.
4462
- */
4463
- #define btrfs_abort_transaction (trans , root , errno ) \
4464
- do { \
4465
- /* Report first abort since mount */ \
4466
- if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
4467
- &((root)->fs_info->fs_state))) { \
4468
- WARN(1, KERN_DEBUG \
4469
- "BTRFS: Transaction aborted (error %d)\n", \
4470
- (errno)); \
4471
- } \
4472
- __btrfs_abort_transaction((trans), (root), __func__, \
4473
- __LINE__, (errno)); \
4474
- } while (0)
4475
-
4476
- #define btrfs_std_error (fs_info , errno , fmt , args ...) \
4477
- do { \
4478
- __btrfs_std_error((fs_info), __func__, __LINE__, \
4479
- (errno), fmt, ##args); \
4480
- } while (0)
4481
-
4482
- __printf (5 , 6 )
4483
- __cold
4484
- void __btrfs_panic (struct btrfs_fs_info * fs_info , const char * function ,
4485
- unsigned int line , int errno , const char * fmt , ...);
4486
-
4487
- /*
4488
- * If BTRFS_MOUNT_PANIC_ON_FATAL_ERROR is in mount_opt, __btrfs_panic
4489
- * will panic(). Otherwise we BUG() here.
4490
- */
4491
- #define btrfs_panic (fs_info , errno , fmt , args ...) \
4492
- do { \
4493
- __btrfs_panic(fs_info, __func__, __LINE__, errno, fmt, ##args); \
4494
- BUG(); \
4495
- } while (0)
4496
-
4497
4498
/* acl.c */
4498
4499
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
4499
4500
struct posix_acl * btrfs_get_acl (struct inode * inode , int type );
0 commit comments