@@ -2099,29 +2099,6 @@ void jbd2_journal_unfile_buffer(journal_t *journal, struct journal_head *jh)
2099
2099
__brelse (bh );
2100
2100
}
2101
2101
2102
- /*
2103
- * Called from jbd2_journal_try_to_free_buffers().
2104
- *
2105
- * Called under jh->b_state_lock
2106
- */
2107
- static void
2108
- __journal_try_to_free_buffer (journal_t * journal , struct buffer_head * bh )
2109
- {
2110
- struct journal_head * jh ;
2111
-
2112
- jh = bh2jh (bh );
2113
-
2114
- if (jh -> b_next_transaction != NULL || jh -> b_transaction != NULL )
2115
- return ;
2116
-
2117
- spin_lock (& journal -> j_list_lock );
2118
- /* Remove written-back checkpointed metadata buffer */
2119
- if (jh -> b_cp_transaction != NULL )
2120
- jbd2_journal_try_remove_checkpoint (jh );
2121
- spin_unlock (& journal -> j_list_lock );
2122
- return ;
2123
- }
2124
-
2125
2102
/**
2126
2103
* jbd2_journal_try_to_free_buffers() - try to free page buffers.
2127
2104
* @journal: journal for operation
@@ -2179,7 +2156,13 @@ bool jbd2_journal_try_to_free_buffers(journal_t *journal, struct folio *folio)
2179
2156
continue ;
2180
2157
2181
2158
spin_lock (& jh -> b_state_lock );
2182
- __journal_try_to_free_buffer (journal , bh );
2159
+ if (!jh -> b_transaction && !jh -> b_next_transaction ) {
2160
+ spin_lock (& journal -> j_list_lock );
2161
+ /* Remove written-back checkpointed metadata buffer */
2162
+ if (jh -> b_cp_transaction != NULL )
2163
+ jbd2_journal_try_remove_checkpoint (jh );
2164
+ spin_unlock (& journal -> j_list_lock );
2165
+ }
2183
2166
spin_unlock (& jh -> b_state_lock );
2184
2167
jbd2_journal_put_journal_head (jh );
2185
2168
if (buffer_jbd (bh ))
0 commit comments