ENUM_BIT(TRANS_START),
ENUM_BIT(TRANS_ATTACH),
ENUM_BIT(TRANS_JOIN),
- ENUM_BIT(TRANS_JOIN_NOLOCK),
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
ENUM_BIT(TRANS_DUMMY),
#endif
[TRANS_STATE_UNBLOCKED] = (TRANS_START |
TRANS_ATTACH |
TRANS_JOIN |
- TRANS_JOIN_NOLOCK |
TRANS_JOIN_NOSTART),
[TRANS_STATE_SUPER_COMMITTED] = (TRANS_START |
TRANS_ATTACH |
TRANS_JOIN |
- TRANS_JOIN_NOLOCK |
TRANS_JOIN_NOSTART),
[TRANS_STATE_COMPLETED] = (TRANS_START |
TRANS_ATTACH |
TRANS_JOIN |
- TRANS_JOIN_NOLOCK |
TRANS_JOIN_NOSTART),
};
if (type == TRANS_ATTACH || type == TRANS_JOIN_NOSTART)
return -ENOENT;
- /*
- * JOIN_NOLOCK only happens during the transaction commit, so
- * it is impossible that ->running_transaction is NULL
- */
- BUG_ON(type == TRANS_JOIN_NOLOCK);
-
cur_trans = kmalloc_obj(*cur_trans, GFP_NOFS);
if (!cur_trans)
return -ENOMEM;
/*
* Only TRANS_START and TRANS_JOIN require sb intwrite lock.
*
- * If we are JOIN_NOLOCK we're already committing a transaction and
- * waiting on this guy, so we don't need to do the sb_start_intwrite
- * because we're already holding a ref. We need this because we could
- * have raced in and did an fsync() on a file which can kick a commit
- * and then we deadlock with somebody doing a freeze.
- *
* If we are ATTACH, it means we just want to catch the current
- * transaction and commit it, so we needn't do sb_start_intwrite().
+ * transaction and commit it, so we needn't do sb_start_intwrite().
*/
if (type & TRANS_SB_INTWRITER_MASK)
sb_start_intwrite(fs_info->sb);