aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/jbd2.h
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/linux/jbd2.h
parent8b67f04ab9de5d8f3a71aef72bf02c995a506db5 (diff)
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/linux/jbd2.h')
-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 5a72bc75b273..a72ce21de0e1 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -601,13 +601,13 @@ struct transaction_s
601 * Number of outstanding updates running on this transaction 601 * Number of outstanding updates running on this transaction
602 * [t_handle_lock] 602 * [t_handle_lock]
603 */ 603 */
604 int t_updates; 604 atomic_t t_updates;
605 605
606 /* 606 /*
607 * Number of buffers reserved for use by all handles in this transaction 607 * Number of buffers reserved for use by all handles in this transaction
608 * handle but not yet modified. [t_handle_lock] 608 * handle but not yet modified. [t_handle_lock]
609 */ 609 */
610 int t_outstanding_credits; 610 atomic_t t_outstanding_credits;
611 611
612 /* 612 /*
613 * Forward and backward links for the circular list of all transactions 613 * Forward and backward links for the circular list of all transactions
@@ -1258,8 +1258,8 @@ static inline int jbd_space_needed(journal_t *journal)
1258{ 1258{
1259 int nblocks = journal->j_max_transaction_buffers; 1259 int nblocks = journal->j_max_transaction_buffers;
1260 if (journal->j_committing_transaction) 1260 if (journal->j_committing_transaction)
1261 nblocks += journal->j_committing_transaction-> 1261 nblocks += atomic_read(&journal->j_committing_transaction->
1262 t_outstanding_credits; 1262 t_outstanding_credits);
1263 return nblocks; 1263 return nblocks;
1264} 1264}
1265 1265