You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
jbd2: Use atomic variables to avoid taking t_handle_lock in jbd2_journal_stop
By using an atomic_t for t_updates and t_outstanding credits, this should allow us to not need to take transaction t_handle_lock in jbd2_journal_stop(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@@ -601,13 +601,13 @@ struct transaction_s
|
||||
* Number of outstanding updates running on this transaction
|
||||
* [t_handle_lock]
|
||||
*/
|
||||
int t_updates;
|
||||
atomic_t t_updates;
|
||||
|
||||
/*
|
||||
* Number of buffers reserved for use by all handles in this transaction
|
||||
* handle but not yet modified. [t_handle_lock]
|
||||
*/
|
||||
int t_outstanding_credits;
|
||||
atomic_t t_outstanding_credits;
|
||||
|
||||
/*
|
||||
* Forward and backward links for the circular list of all transactions
|
||||
@@ -1258,8 +1258,8 @@ static inline int jbd_space_needed(journal_t *journal)
|
||||
{
|
||||
int nblocks = journal->j_max_transaction_buffers;
|
||||
if (journal->j_committing_transaction)
|
||||
nblocks += journal->j_committing_transaction->
|
||||
t_outstanding_credits;
|
||||
nblocks += atomic_read(&journal->j_committing_transaction->
|
||||
t_outstanding_credits);
|
||||
return nblocks;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user