* Call btrfs_abort_transaction as early as possible when an error condition is
  * detected, that way the exact line number is reported.
  */
-
 #define btrfs_abort_transaction(trans, root, errno)            \
 do {                                                           \
-       __btrfs_abort_transaction(trans, root, __func__,        \
-                                 __LINE__, errno);             \
+       /* Report first abort since mount */                    \
+       if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED,     \
+                       &((root)->fs_info->fs_state))) {        \
+               WARN(1, KERN_DEBUG                              \
+               "BTRFS: Transaction aborted (error %d)\n",      \
+               (errno));                                       \
+       }                                                       \
+       __btrfs_abort_transaction((trans), (root), __func__,    \
+                                 __LINE__, (errno));           \
 } while (0)
 
 #define btrfs_std_error(fs_info, errno)                                \
 
                               struct btrfs_root *root, const char *function,
                               unsigned int line, int errno)
 {
-       /*
-        * Report first abort since mount
-        */
-       if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED,
-                               &root->fs_info->fs_state)) {
-               WARN(1, KERN_DEBUG "BTRFS: Transaction aborted (error %d)\n",
-                               errno);
-       }
        trans->aborted = errno;
        /* Nothing used. The other threads that have joined this
         * transaction may be able to continue. */