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