diff options
| author | Tal Zussman <tz2294@columbia.edu> | 2026-10-15 10:43:32 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-16 19:10:46 +0200 |
| commit | 293aae0123e1c178c7f76fd7a93bcced41e6663c (patch) | |
| tree | f844860f978f6c59462f5dd546a1f2179bea7504 | |
| parent | a09f52a06dc45eba3c739700a9540fadb4d1efff (diff) | |
btrfs: remove TRANS_JOIN_NOLOCK
btrfs_join_transaction_spacecache() was the only user of
TRANS_JOIN_NOLOCK and is gone, so remove the join type, its entries in
the blocked types table, and the special cases in join_transaction() and
start_transaction().
Assisted-by: LLM
Signed-off-by: Tal Zussman <tz2294@columbia.edu>
Signed-off-by: David Sterba <dsterba@suse.com>
| -rw-r--r-- | fs/btrfs/transaction.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 7431a06f168d..d265fac023e5 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -42,7 +42,6 @@ enum { 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 @@ -141,17 +140,14 @@ static const unsigned int btrfs_blocked_trans_types[TRANS_STATE_MAX] = { [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), }; @@ -342,12 +338,6 @@ loop: 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; @@ -750,14 +740,8 @@ again: /* * 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); |
