1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include <linux/time.h>
17#include <linux/fs.h>
18#include <linux/jbd.h>
19#include <linux/errno.h>
20#include <linux/slab.h>
21#include <linux/mm.h>
22#include <linux/pagemap.h>
23
24
25
26
27static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
28{
29 BUFFER_TRACE(bh, "");
30 if (uptodate)
31 set_buffer_uptodate(bh);
32 else
33 clear_buffer_uptodate(bh);
34 unlock_buffer(bh);
35}
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51static void release_buffer_page(struct buffer_head *bh)
52{
53 struct page *page;
54
55 if (buffer_dirty(bh))
56 goto nope;
57 if (atomic_read(&bh->b_count) != 1)
58 goto nope;
59 page = bh->b_page;
60 if (!page)
61 goto nope;
62 if (page->mapping)
63 goto nope;
64
65
66 if (!trylock_page(page))
67 goto nope;
68
69 page_cache_get(page);
70 __brelse(bh);
71 try_to_free_buffers(page);
72 unlock_page(page);
73 page_cache_release(page);
74 return;
75
76nope:
77 __brelse(bh);
78}
79
80
81
82
83
84static void release_data_buffer(struct buffer_head *bh)
85{
86 if (buffer_freed(bh)) {
87 clear_buffer_freed(bh);
88 release_buffer_page(bh);
89 } else
90 put_bh(bh);
91}
92
93
94
95
96
97
98static int inverted_lock(journal_t *journal, struct buffer_head *bh)
99{
100 if (!jbd_trylock_bh_state(bh)) {
101 spin_unlock(&journal->j_list_lock);
102 schedule();
103 return 0;
104 }
105 return 1;
106}
107
108
109
110
111
112
113
114
115static int journal_write_commit_record(journal_t *journal,
116 transaction_t *commit_transaction)
117{
118 struct journal_head *descriptor;
119 struct buffer_head *bh;
120 journal_header_t *header;
121 int ret;
122 int barrier_done = 0;
123
124 if (is_journal_aborted(journal))
125 return 0;
126
127 descriptor = journal_get_descriptor_buffer(journal);
128 if (!descriptor)
129 return 1;
130
131 bh = jh2bh(descriptor);
132
133 header = (journal_header_t *)(bh->b_data);
134 header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
135 header->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK);
136 header->h_sequence = cpu_to_be32(commit_transaction->t_tid);
137
138 JBUFFER_TRACE(descriptor, "write commit block");
139 set_buffer_dirty(bh);
140 if (journal->j_flags & JFS_BARRIER) {
141 set_buffer_ordered(bh);
142 barrier_done = 1;
143 }
144 ret = sync_dirty_buffer(bh);
145 if (barrier_done)
146 clear_buffer_ordered(bh);
147
148
149
150
151
152 if (ret == -EOPNOTSUPP && barrier_done) {
153 char b[BDEVNAME_SIZE];
154
155 printk(KERN_WARNING
156 "JBD: barrier-based sync failed on %s - "
157 "disabling barriers\n",
158 bdevname(journal->j_dev, b));
159 spin_lock(&journal->j_state_lock);
160 journal->j_flags &= ~JFS_BARRIER;
161 spin_unlock(&journal->j_state_lock);
162
163
164 set_buffer_uptodate(bh);
165 set_buffer_dirty(bh);
166 ret = sync_dirty_buffer(bh);
167 }
168 put_bh(bh);
169 journal_put_journal_head(descriptor);
170
171 return (ret == -EIO);
172}
173
174static void journal_do_submit_data(struct buffer_head **wbuf, int bufs)
175{
176 int i;
177
178 for (i = 0; i < bufs; i++) {
179 wbuf[i]->b_end_io = end_buffer_write_sync;
180
181 submit_bh(WRITE, wbuf[i]);
182 }
183}
184
185
186
187
188static int journal_submit_data_buffers(journal_t *journal,
189 transaction_t *commit_transaction)
190{
191 struct journal_head *jh;
192 struct buffer_head *bh;
193 int locked;
194 int bufs = 0;
195 struct buffer_head **wbuf = journal->j_wbuf;
196 int err = 0;
197
198
199
200
201
202
203
204
205
206write_out_data:
207 cond_resched();
208 spin_lock(&journal->j_list_lock);
209
210 while (commit_transaction->t_sync_datalist) {
211 jh = commit_transaction->t_sync_datalist;
212 bh = jh2bh(jh);
213 locked = 0;
214
215
216
217 get_bh(bh);
218
219
220
221
222
223 if (buffer_dirty(bh)) {
224 if (!trylock_buffer(bh)) {
225 BUFFER_TRACE(bh, "needs blocking lock");
226 spin_unlock(&journal->j_list_lock);
227
228 journal_do_submit_data(wbuf, bufs);
229 bufs = 0;
230 lock_buffer(bh);
231 spin_lock(&journal->j_list_lock);
232 }
233 locked = 1;
234 }
235
236 if (!inverted_lock(journal, bh)) {
237 jbd_lock_bh_state(bh);
238 spin_lock(&journal->j_list_lock);
239 }
240
241 if (!buffer_jbd(bh)
242 || jh->b_transaction != commit_transaction
243 || jh->b_jlist != BJ_SyncData) {
244 jbd_unlock_bh_state(bh);
245 if (locked)
246 unlock_buffer(bh);
247 BUFFER_TRACE(bh, "already cleaned up");
248 release_data_buffer(bh);
249 continue;
250 }
251 if (locked && test_clear_buffer_dirty(bh)) {
252 BUFFER_TRACE(bh, "needs writeout, adding to array");
253 wbuf[bufs++] = bh;
254 __journal_file_buffer(jh, commit_transaction,
255 BJ_Locked);
256 jbd_unlock_bh_state(bh);
257 if (bufs == journal->j_wbufsize) {
258 spin_unlock(&journal->j_list_lock);
259 journal_do_submit_data(wbuf, bufs);
260 bufs = 0;
261 goto write_out_data;
262 }
263 } else if (!locked && buffer_locked(bh)) {
264 __journal_file_buffer(jh, commit_transaction,
265 BJ_Locked);
266 jbd_unlock_bh_state(bh);
267 put_bh(bh);
268 } else {
269 BUFFER_TRACE(bh, "writeout complete: unfile");
270 if (unlikely(!buffer_uptodate(bh)))
271 err = -EIO;
272 __journal_unfile_buffer(jh);
273 jbd_unlock_bh_state(bh);
274 if (locked)
275 unlock_buffer(bh);
276 journal_remove_journal_head(bh);
277
278
279 put_bh(bh);
280 release_data_buffer(bh);
281 }
282
283 if (need_resched() || spin_needbreak(&journal->j_list_lock)) {
284 spin_unlock(&journal->j_list_lock);
285 goto write_out_data;
286 }
287 }
288 spin_unlock(&journal->j_list_lock);
289 journal_do_submit_data(wbuf, bufs);
290
291 return err;
292}
293
294
295
296
297
298
299
300void journal_commit_transaction(journal_t *journal)
301{
302 transaction_t *commit_transaction;
303 struct journal_head *jh, *new_jh, *descriptor;
304 struct buffer_head **wbuf = journal->j_wbuf;
305 int bufs;
306 int flags;
307 int err;
308 unsigned long blocknr;
309 char *tagp = NULL;
310 journal_header_t *header;
311 journal_block_tag_t *tag = NULL;
312 int space_left = 0;
313 int first_tag = 0;
314 int tag_flag;
315 int i;
316
317
318
319
320
321
322#ifdef COMMIT_STATS
323 spin_lock(&journal->j_list_lock);
324 summarise_journal_usage(journal);
325 spin_unlock(&journal->j_list_lock);
326#endif
327
328
329 if (journal->j_flags & JFS_FLUSHED) {
330 jbd_debug(3, "super block updated\n");
331 journal_update_superblock(journal, 1);
332 } else {
333 jbd_debug(3, "superblock not updated\n");
334 }
335
336 J_ASSERT(journal->j_running_transaction != NULL);
337 J_ASSERT(journal->j_committing_transaction == NULL);
338
339 commit_transaction = journal->j_running_transaction;
340 J_ASSERT(commit_transaction->t_state == T_RUNNING);
341
342 jbd_debug(1, "JBD: starting commit of transaction %d\n",
343 commit_transaction->t_tid);
344
345 spin_lock(&journal->j_state_lock);
346 commit_transaction->t_state = T_LOCKED;
347
348 spin_lock(&commit_transaction->t_handle_lock);
349 while (commit_transaction->t_updates) {
350 DEFINE_WAIT(wait);
351
352 prepare_to_wait(&journal->j_wait_updates, &wait,
353 TASK_UNINTERRUPTIBLE);
354 if (commit_transaction->t_updates) {
355 spin_unlock(&commit_transaction->t_handle_lock);
356 spin_unlock(&journal->j_state_lock);
357 schedule();
358 spin_lock(&journal->j_state_lock);
359 spin_lock(&commit_transaction->t_handle_lock);
360 }
361 finish_wait(&journal->j_wait_updates, &wait);
362 }
363 spin_unlock(&commit_transaction->t_handle_lock);
364
365 J_ASSERT (commit_transaction->t_outstanding_credits <=
366 journal->j_max_transaction_buffers);
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384 while (commit_transaction->t_reserved_list) {
385 jh = commit_transaction->t_reserved_list;
386 JBUFFER_TRACE(jh, "reserved, unused: refile");
387
388
389
390
391 if (jh->b_committed_data) {
392 struct buffer_head *bh = jh2bh(jh);
393
394 jbd_lock_bh_state(bh);
395 jbd_free(jh->b_committed_data, bh->b_size);
396 jh->b_committed_data = NULL;
397 jbd_unlock_bh_state(bh);
398 }
399 journal_refile_buffer(journal, jh);
400 }
401
402
403
404
405
406
407 spin_lock(&journal->j_list_lock);
408 __journal_clean_checkpoint_list(journal);
409 spin_unlock(&journal->j_list_lock);
410
411 jbd_debug (3, "JBD: commit phase 1\n");
412
413
414
415
416 journal_switch_revoke_table(journal);
417
418 commit_transaction->t_state = T_FLUSH;
419 journal->j_committing_transaction = commit_transaction;
420 journal->j_running_transaction = NULL;
421 commit_transaction->t_log_start = journal->j_head;
422 wake_up(&journal->j_wait_transaction_locked);
423 spin_unlock(&journal->j_state_lock);
424
425 jbd_debug (3, "JBD: commit phase 2\n");
426
427
428
429
430
431 err = journal_submit_data_buffers(journal, commit_transaction);
432
433
434
435
436 spin_lock(&journal->j_list_lock);
437 while (commit_transaction->t_locked_list) {
438 struct buffer_head *bh;
439
440 jh = commit_transaction->t_locked_list->b_tprev;
441 bh = jh2bh(jh);
442 get_bh(bh);
443 if (buffer_locked(bh)) {
444 spin_unlock(&journal->j_list_lock);
445 wait_on_buffer(bh);
446 spin_lock(&journal->j_list_lock);
447 }
448 if (unlikely(!buffer_uptodate(bh))) {
449 if (!trylock_page(bh->b_page)) {
450 spin_unlock(&journal->j_list_lock);
451 lock_page(bh->b_page);
452 spin_lock(&journal->j_list_lock);
453 }
454 if (bh->b_page->mapping)
455 set_bit(AS_EIO, &bh->b_page->mapping->flags);
456
457 unlock_page(bh->b_page);
458 SetPageError(bh->b_page);
459 err = -EIO;
460 }
461 if (!inverted_lock(journal, bh)) {
462 put_bh(bh);
463 spin_lock(&journal->j_list_lock);
464 continue;
465 }
466 if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
467 __journal_unfile_buffer(jh);
468 jbd_unlock_bh_state(bh);
469 journal_remove_journal_head(bh);
470 put_bh(bh);
471 } else {
472 jbd_unlock_bh_state(bh);
473 }
474 release_data_buffer(bh);
475 cond_resched_lock(&journal->j_list_lock);
476 }
477 spin_unlock(&journal->j_list_lock);
478
479 if (err) {
480 char b[BDEVNAME_SIZE];
481
482 printk(KERN_WARNING
483 "JBD: Detected IO errors while flushing file data "
484 "on %s\n", bdevname(journal->j_fs_dev, b));
485 if (journal->j_flags & JFS_ABORT_ON_SYNCDATA_ERR)
486 journal_abort(journal, err);
487 err = 0;
488 }
489
490 journal_write_revoke_records(journal, commit_transaction);
491
492
493
494
495
496
497
498 J_ASSERT (commit_transaction->t_sync_datalist == NULL);
499
500 jbd_debug (3, "JBD: commit phase 3\n");
501
502
503
504
505
506
507 spin_lock(&journal->j_state_lock);
508 commit_transaction->t_state = T_COMMIT;
509 spin_unlock(&journal->j_state_lock);
510
511 J_ASSERT(commit_transaction->t_nr_buffers <=
512 commit_transaction->t_outstanding_credits);
513
514 descriptor = NULL;
515 bufs = 0;
516 while (commit_transaction->t_buffers) {
517
518
519
520 jh = commit_transaction->t_buffers;
521
522
523
524
525 if (is_journal_aborted(journal)) {
526 clear_buffer_jbddirty(jh2bh(jh));
527 JBUFFER_TRACE(jh, "journal is aborting: refile");
528 journal_refile_buffer(journal, jh);
529
530
531
532
533 if (!commit_transaction->t_buffers)
534 goto start_journal_io;
535 continue;
536 }
537
538
539
540
541 if (!descriptor) {
542 struct buffer_head *bh;
543
544 J_ASSERT (bufs == 0);
545
546 jbd_debug(4, "JBD: get descriptor\n");
547
548 descriptor = journal_get_descriptor_buffer(journal);
549 if (!descriptor) {
550 journal_abort(journal, -EIO);
551 continue;
552 }
553
554 bh = jh2bh(descriptor);
555 jbd_debug(4, "JBD: got buffer %llu (%p)\n",
556 (unsigned long long)bh->b_blocknr, bh->b_data);
557 header = (journal_header_t *)&bh->b_data[0];
558 header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
559 header->h_blocktype = cpu_to_be32(JFS_DESCRIPTOR_BLOCK);
560 header->h_sequence = cpu_to_be32(commit_transaction->t_tid);
561
562 tagp = &bh->b_data[sizeof(journal_header_t)];
563 space_left = bh->b_size - sizeof(journal_header_t);
564 first_tag = 1;
565 set_buffer_jwrite(bh);
566 set_buffer_dirty(bh);
567 wbuf[bufs++] = bh;
568
569
570
571 BUFFER_TRACE(bh, "ph3: file as descriptor");
572 journal_file_buffer(descriptor, commit_transaction,
573 BJ_LogCtl);
574 }
575
576
577
578 err = journal_next_log_block(journal, &blocknr);
579
580
581
582 if (err) {
583 journal_abort(journal, err);
584 continue;
585 }
586
587
588
589
590
591
592 commit_transaction->t_outstanding_credits--;
593
594
595
596
597 atomic_inc(&jh2bh(jh)->b_count);
598
599
600
601
602
603 set_bit(BH_JWrite, &jh2bh(jh)->b_state);
604
605
606
607
608
609
610 JBUFFER_TRACE(jh, "ph3: write metadata");
611 flags = journal_write_metadata_buffer(commit_transaction,
612 jh, &new_jh, blocknr);
613 set_bit(BH_JWrite, &jh2bh(new_jh)->b_state);
614 wbuf[bufs++] = jh2bh(new_jh);
615
616
617
618
619 tag_flag = 0;
620 if (flags & 1)
621 tag_flag |= JFS_FLAG_ESCAPE;
622 if (!first_tag)
623 tag_flag |= JFS_FLAG_SAME_UUID;
624
625 tag = (journal_block_tag_t *) tagp;
626 tag->t_blocknr = cpu_to_be32(jh2bh(jh)->b_blocknr);
627 tag->t_flags = cpu_to_be32(tag_flag);
628 tagp += sizeof(journal_block_tag_t);
629 space_left -= sizeof(journal_block_tag_t);
630
631 if (first_tag) {
632 memcpy (tagp, journal->j_uuid, 16);
633 tagp += 16;
634 space_left -= 16;
635 first_tag = 0;
636 }
637
638
639
640
641 if (bufs == journal->j_wbufsize ||
642 commit_transaction->t_buffers == NULL ||
643 space_left < sizeof(journal_block_tag_t) + 16) {
644
645 jbd_debug(4, "JBD: Submit %d IOs\n", bufs);
646
647
648
649
650
651 tag->t_flags |= cpu_to_be32(JFS_FLAG_LAST_TAG);
652
653start_journal_io:
654 for (i = 0; i < bufs; i++) {
655 struct buffer_head *bh = wbuf[i];
656 lock_buffer(bh);
657 clear_buffer_dirty(bh);
658 set_buffer_uptodate(bh);
659 bh->b_end_io = journal_end_buffer_io_sync;
660 submit_bh(WRITE, bh);
661 }
662 cond_resched();
663
664
665
666 descriptor = NULL;
667 bufs = 0;
668 }
669 }
670
671
672
673
674
675
676
677
678
679
680
681
682 jbd_debug(3, "JBD: commit phase 4\n");
683
684
685
686
687
688wait_for_iobuf:
689 while (commit_transaction->t_iobuf_list != NULL) {
690 struct buffer_head *bh;
691
692 jh = commit_transaction->t_iobuf_list->b_tprev;
693 bh = jh2bh(jh);
694 if (buffer_locked(bh)) {
695 wait_on_buffer(bh);
696 goto wait_for_iobuf;
697 }
698 if (cond_resched())
699 goto wait_for_iobuf;
700
701 if (unlikely(!buffer_uptodate(bh)))
702 err = -EIO;
703
704 clear_buffer_jwrite(bh);
705
706 JBUFFER_TRACE(jh, "ph4: unfile after journal write");
707 journal_unfile_buffer(journal, jh);
708
709
710
711
712
713 BUFFER_TRACE(bh, "dumping temporary bh");
714 journal_put_journal_head(jh);
715 __brelse(bh);
716 J_ASSERT_BH(bh, atomic_read(&bh->b_count) == 0);
717 free_buffer_head(bh);
718
719
720
721 jh = commit_transaction->t_shadow_list->b_tprev;
722 bh = jh2bh(jh);
723 clear_bit(BH_JWrite, &bh->b_state);
724 J_ASSERT_BH(bh, buffer_jbddirty(bh));
725
726
727
728
729
730 JBUFFER_TRACE(jh, "file as BJ_Forget");
731 journal_file_buffer(jh, commit_transaction, BJ_Forget);
732
733
734 wake_up_bit(&bh->b_state, BH_Unshadow);
735 JBUFFER_TRACE(jh, "brelse shadowed buffer");
736 __brelse(bh);
737 }
738
739 J_ASSERT (commit_transaction->t_shadow_list == NULL);
740
741 jbd_debug(3, "JBD: commit phase 5\n");
742
743
744 wait_for_ctlbuf:
745 while (commit_transaction->t_log_list != NULL) {
746 struct buffer_head *bh;
747
748 jh = commit_transaction->t_log_list->b_tprev;
749 bh = jh2bh(jh);
750 if (buffer_locked(bh)) {
751 wait_on_buffer(bh);
752 goto wait_for_ctlbuf;
753 }
754 if (cond_resched())
755 goto wait_for_ctlbuf;
756
757 if (unlikely(!buffer_uptodate(bh)))
758 err = -EIO;
759
760 BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile");
761 clear_buffer_jwrite(bh);
762 journal_unfile_buffer(journal, jh);
763 journal_put_journal_head(jh);
764 __brelse(bh);
765
766 }
767
768 if (err)
769 journal_abort(journal, err);
770
771 jbd_debug(3, "JBD: commit phase 6\n");
772
773 if (journal_write_commit_record(journal, commit_transaction))
774 err = -EIO;
775
776 if (err)
777 journal_abort(journal, err);
778
779
780
781
782
783
784 jbd_debug(3, "JBD: commit phase 7\n");
785
786 J_ASSERT(commit_transaction->t_sync_datalist == NULL);
787 J_ASSERT(commit_transaction->t_buffers == NULL);
788 J_ASSERT(commit_transaction->t_checkpoint_list == NULL);
789 J_ASSERT(commit_transaction->t_iobuf_list == NULL);
790 J_ASSERT(commit_transaction->t_shadow_list == NULL);
791 J_ASSERT(commit_transaction->t_log_list == NULL);
792
793restart_loop:
794
795
796
797
798 spin_lock(&journal->j_list_lock);
799 while (commit_transaction->t_forget) {
800 transaction_t *cp_transaction;
801 struct buffer_head *bh;
802
803 jh = commit_transaction->t_forget;
804 spin_unlock(&journal->j_list_lock);
805 bh = jh2bh(jh);
806 jbd_lock_bh_state(bh);
807 J_ASSERT_JH(jh, jh->b_transaction == commit_transaction ||
808 jh->b_transaction == journal->j_running_transaction);
809
810
811
812
813
814
815
816
817
818
819
820 if (jh->b_committed_data) {
821 jbd_free(jh->b_committed_data, bh->b_size);
822 jh->b_committed_data = NULL;
823 if (jh->b_frozen_data) {
824 jh->b_committed_data = jh->b_frozen_data;
825 jh->b_frozen_data = NULL;
826 }
827 } else if (jh->b_frozen_data) {
828 jbd_free(jh->b_frozen_data, bh->b_size);
829 jh->b_frozen_data = NULL;
830 }
831
832 spin_lock(&journal->j_list_lock);
833 cp_transaction = jh->b_cp_transaction;
834 if (cp_transaction) {
835 JBUFFER_TRACE(jh, "remove from old cp transaction");
836 __journal_remove_checkpoint(jh);
837 }
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853 if (buffer_freed(bh)) {
854 clear_buffer_freed(bh);
855 clear_buffer_jbddirty(bh);
856 }
857
858 if (buffer_jbddirty(bh)) {
859 JBUFFER_TRACE(jh, "add to new checkpointing trans");
860 __journal_insert_checkpoint(jh, commit_transaction);
861 if (is_journal_aborted(journal))
862 clear_buffer_jbddirty(bh);
863 JBUFFER_TRACE(jh, "refile for checkpoint writeback");
864 __journal_refile_buffer(jh);
865 jbd_unlock_bh_state(bh);
866 } else {
867 J_ASSERT_BH(bh, !buffer_dirty(bh));
868
869
870
871
872
873
874
875 JBUFFER_TRACE(jh, "refile or unfile freed buffer");
876 __journal_refile_buffer(jh);
877 if (!jh->b_transaction) {
878 jbd_unlock_bh_state(bh);
879
880 journal_remove_journal_head(bh);
881 release_buffer_page(bh);
882 } else
883 jbd_unlock_bh_state(bh);
884 }
885 cond_resched_lock(&journal->j_list_lock);
886 }
887 spin_unlock(&journal->j_list_lock);
888
889
890
891
892
893
894 spin_lock(&journal->j_state_lock);
895 spin_lock(&journal->j_list_lock);
896
897
898
899
900 if (commit_transaction->t_forget) {
901 spin_unlock(&journal->j_list_lock);
902 spin_unlock(&journal->j_state_lock);
903 goto restart_loop;
904 }
905
906
907
908 jbd_debug(3, "JBD: commit phase 8\n");
909
910 J_ASSERT(commit_transaction->t_state == T_COMMIT);
911
912 commit_transaction->t_state = T_FINISHED;
913 J_ASSERT(commit_transaction == journal->j_committing_transaction);
914 journal->j_commit_sequence = commit_transaction->t_tid;
915 journal->j_committing_transaction = NULL;
916 spin_unlock(&journal->j_state_lock);
917
918 if (commit_transaction->t_checkpoint_list == NULL &&
919 commit_transaction->t_checkpoint_io_list == NULL) {
920 __journal_drop_transaction(journal, commit_transaction);
921 } else {
922 if (journal->j_checkpoint_transactions == NULL) {
923 journal->j_checkpoint_transactions = commit_transaction;
924 commit_transaction->t_cpnext = commit_transaction;
925 commit_transaction->t_cpprev = commit_transaction;
926 } else {
927 commit_transaction->t_cpnext =
928 journal->j_checkpoint_transactions;
929 commit_transaction->t_cpprev =
930 commit_transaction->t_cpnext->t_cpprev;
931 commit_transaction->t_cpnext->t_cpprev =
932 commit_transaction;
933 commit_transaction->t_cpprev->t_cpnext =
934 commit_transaction;
935 }
936 }
937 spin_unlock(&journal->j_list_lock);
938
939 jbd_debug(1, "JBD: commit %d complete, head %d\n",
940 journal->j_commit_sequence, journal->j_tail_sequence);
941
942 wake_up(&journal->j_wait_done_commit);
943}
944