143 if (space_left < nblocks) {
144 int chkpt = journal->j_checkpoint_transactions != NULL;
145 tid_t tid = 0;
146
147 if (journal->j_committing_transaction)
148 tid = journal->j_committing_transaction->t_tid;
149 spin_unlock(&journal->j_list_lock);
150 spin_unlock(&journal->j_state_lock);
151 if (chkpt) {
152 log_do_checkpoint(journal);
153 } else if (cleanup_journal_tail(journal) == 0) {
154
155 ;
156 } else if (tid) {
157 log_wait_commit(journal, tid);
158 } else {
159 printk(KERN_ERR "%s: needed %d blocks and "
160 "only had %d space available\n",
161 __func__, nblocks, space_left);
162 printk(KERN_ERR "%s: no way to get more "
163 "journal space\n", __func__);
164 WARN_ON(1);
165 journal_abort(journal, 0);
166 }
167 spin_lock(&journal->j_state_lock);
168 } else {
169 spin_unlock(&journal->j_list_lock);
170 }
171 mutex_unlock(&journal->j_checkpoint_mutex);
172 }
173}
174
175
176
177
178
179
180static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
181 __releases(journal->j_list_lock)
182{
183 get_bh(bh);