transaction.c (ab714aff4f744f52f0beae93ed441f2f5585eb7a) transaction.c (1eaa566d368b214d99cbb973647c1b0b8102a9ae)
1/*
2 * linux/fs/jbd2/transaction.c
3 *
4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998
5 *
6 * Copyright 1998 Red Hat corp --- All Rights Reserved
7 *
8 * This file is part of the Linux kernel and is made available under

--- 168 unchanged lines hidden (view full) ---

177 */
178static int add_transaction_credits(journal_t *journal, int blocks,
179 int rsv_blocks)
180{
181 transaction_t *t = journal->j_running_transaction;
182 int needed;
183 int total = blocks + rsv_blocks;
184
1/*
2 * linux/fs/jbd2/transaction.c
3 *
4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998
5 *
6 * Copyright 1998 Red Hat corp --- All Rights Reserved
7 *
8 * This file is part of the Linux kernel and is made available under

--- 168 unchanged lines hidden (view full) ---

177 */
178static int add_transaction_credits(journal_t *journal, int blocks,
179 int rsv_blocks)
180{
181 transaction_t *t = journal->j_running_transaction;
182 int needed;
183 int total = blocks + rsv_blocks;
184
185 jbd2_might_wait_for_commit(journal);
186
185 /*
186 * If the current transaction is locked down for commit, wait
187 * for the lock to be released.
188 */
189 if (t->t_state == T_LOCKED) {
190 wait_transaction_locked(journal);
191 return 1;
192 }

--- 497 unchanged lines hidden (view full) ---

690 * journal is in a quiescent state with no updates running.
691 *
692 * The journal lock should not be held on entry.
693 */
694void jbd2_journal_lock_updates(journal_t *journal)
695{
696 DEFINE_WAIT(wait);
697
187 /*
188 * If the current transaction is locked down for commit, wait
189 * for the lock to be released.
190 */
191 if (t->t_state == T_LOCKED) {
192 wait_transaction_locked(journal);
193 return 1;
194 }

--- 497 unchanged lines hidden (view full) ---

692 * journal is in a quiescent state with no updates running.
693 *
694 * The journal lock should not be held on entry.
695 */
696void jbd2_journal_lock_updates(journal_t *journal)
697{
698 DEFINE_WAIT(wait);
699
700 jbd2_might_wait_for_commit(journal);
701
698 write_lock(&journal->j_state_lock);
699 ++journal->j_barrier_count;
700
701 /* Wait until there are no reserved handles */
702 if (atomic_read(&journal->j_reserved_credits)) {
703 write_unlock(&journal->j_state_lock);
704 wait_event(journal->j_wait_reserved,
705 atomic_read(&journal->j_reserved_credits) == 0);

--- 1877 unchanged lines hidden ---
702 write_lock(&journal->j_state_lock);
703 ++journal->j_barrier_count;
704
705 /* Wait until there are no reserved handles */
706 if (atomic_read(&journal->j_reserved_credits)) {
707 write_unlock(&journal->j_state_lock);
708 wait_event(journal->j_wait_reserved,
709 atomic_read(&journal->j_reserved_credits) == 0);

--- 1877 unchanged lines hidden ---