371 transaction = journal->j_checkpoint_transactions;
372 this_tid = transaction->t_tid;
373restart:
374
375
376
377
378
379 if (journal->j_checkpoint_transactions == transaction &&
380 transaction->t_tid == this_tid) {
381 int batch_count = 0;
382 struct buffer_head *bhs[NR_BATCH];
383 struct journal_head *jh;
384 int retry = 0, err;
385
386 while (!retry && transaction->t_checkpoint_list) {
387 struct buffer_head *bh;
388
389 jh = transaction->t_checkpoint_list;
390 bh = jh2bh(jh);
391 if (!jbd_trylock_bh_state(bh)) {
392 jbd_sync_bh(journal, bh);
393 retry = 1;
394 break;
395 }
396 retry = __process_buffer(journal, jh, bhs,&batch_count);
397 if (retry < 0 && !result)
398 result = retry;
399 if (!retry && (need_resched() ||
400 spin_needbreak(&journal->j_list_lock))) {
401 spin_unlock(&journal->j_list_lock);
402 retry = 1;
403 break;
404 }
405 }
406
407 if (batch_count) {
408 if (!retry) {
409 spin_unlock(&journal->j_list_lock);
410 retry = 1;
411 }