@@ -323,17 +323,6 @@ static inline void btree_insert_entry_checks(struct btree_trans *trans,
323323 bch2_snapshot_is_internal_node (trans -> c , i -> k -> k .p .snapshot ));
324324}
325325
326- static noinline int
327- bch2_trans_journal_preres_get_cold (struct btree_trans * trans , unsigned flags ,
328- unsigned long trace_ip )
329- {
330- return drop_locks_do (trans ,
331- bch2_journal_preres_get (& trans -> c -> journal ,
332- & trans -> journal_preres ,
333- trans -> journal_preres_u64s ,
334- (flags & BCH_WATERMARK_MASK )));
335- }
336-
337326static __always_inline int bch2_trans_journal_res_get (struct btree_trans * trans ,
338327 unsigned flags )
339328{
@@ -882,14 +871,6 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans, unsigned flags
882871 }
883872 }
884873
885- ret = bch2_journal_preres_get (& c -> journal ,
886- & trans -> journal_preres , trans -> journal_preres_u64s ,
887- (flags & BCH_WATERMARK_MASK )|JOURNAL_RES_GET_NONBLOCK );
888- if (unlikely (ret == - BCH_ERR_journal_preres_get_blocked ))
889- ret = bch2_trans_journal_preres_get_cold (trans , flags , trace_ip );
890- if (unlikely (ret ))
891- return ret ;
892-
893874 ret = bch2_trans_lock_write (trans );
894875 if (unlikely (ret ))
895876 return ret ;
@@ -1052,7 +1033,6 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags)
10521033 struct bch_fs * c = trans -> c ;
10531034 struct btree_insert_entry * i = NULL ;
10541035 struct btree_write_buffered_key * wb ;
1055- unsigned u64s ;
10561036 int ret = 0 ;
10571037
10581038 if (!trans -> nr_updates &&
@@ -1112,13 +1092,8 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags)
11121092
11131093 EBUG_ON (test_bit (BCH_FS_CLEAN_SHUTDOWN , & c -> flags ));
11141094
1115- memset (& trans -> journal_preres , 0 , sizeof (trans -> journal_preres ));
1116-
11171095 trans -> journal_u64s = trans -> extra_journal_entries .nr ;
1118- trans -> journal_preres_u64s = 0 ;
1119-
11201096 trans -> journal_transaction_names = READ_ONCE (c -> opts .journal_transaction_names );
1121-
11221097 if (trans -> journal_transaction_names )
11231098 trans -> journal_u64s += jset_u64s (JSET_ENTRY_LOG_U64s );
11241099
@@ -1134,16 +1109,11 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags)
11341109 if (i -> key_cache_already_flushed )
11351110 continue ;
11361111
1137- /* we're going to journal the key being updated: */
1138- u64s = jset_u64s (i -> k -> k .u64s );
1139- if (i -> cached &&
1140- likely (!(flags & BTREE_INSERT_JOURNAL_REPLAY )))
1141- trans -> journal_preres_u64s += u64s ;
1142-
11431112 if (i -> flags & BTREE_UPDATE_NOJOURNAL )
11441113 continue ;
11451114
1146- trans -> journal_u64s += u64s ;
1115+ /* we're going to journal the key being updated: */
1116+ trans -> journal_u64s += jset_u64s (i -> k -> k .u64s );
11471117
11481118 /* and we're also going to log the overwrite: */
11491119 if (trans -> journal_transaction_names )
@@ -1175,8 +1145,6 @@ int __bch2_trans_commit(struct btree_trans *trans, unsigned flags)
11751145
11761146 trace_and_count (c , transaction_commit , trans , _RET_IP_ );
11771147out :
1178- bch2_journal_preres_put (& c -> journal , & trans -> journal_preres );
1179-
11801148 if (likely (!(flags & BTREE_INSERT_NOCHECK_RW )))
11811149 bch2_write_ref_put (c , BCH_WRITE_REF_trans );
11821150out_reset :
0 commit comments