summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-08-02 08:43:25 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-08-02 08:43:25 -0400
commita51dca9cd3bb4ec5a05bfb6feabf024a5c808a37 (patch)
tree31256b4fa3ec1d0e1e27196607499877c662ee86 /include
parent8b67f04ab9de5d8f3a71aef72bf02c995a506db5 (diff)
downloadop-kernel-dev-a51dca9cd3bb4ec5a05bfb6feabf024a5c808a37.zip
op-kernel-dev-a51dca9cd3bb4ec5a05bfb6feabf024a5c808a37.tar.gz
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/jbd2.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 5a72bc7..a72ce21 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -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;
}
OpenPOWER on IntegriCloud