Lines Matching refs:jh
33 static inline void __buffer_unlink_first(struct journal_head *jh) in __buffer_unlink_first() argument
35 transaction_t *transaction = jh->b_cp_transaction; in __buffer_unlink_first()
37 jh->b_cpnext->b_cpprev = jh->b_cpprev; in __buffer_unlink_first()
38 jh->b_cpprev->b_cpnext = jh->b_cpnext; in __buffer_unlink_first()
39 if (transaction->t_checkpoint_list == jh) { in __buffer_unlink_first()
40 transaction->t_checkpoint_list = jh->b_cpnext; in __buffer_unlink_first()
41 if (transaction->t_checkpoint_list == jh) in __buffer_unlink_first()
51 static inline void __buffer_unlink(struct journal_head *jh) in __buffer_unlink() argument
53 transaction_t *transaction = jh->b_cp_transaction; in __buffer_unlink()
55 __buffer_unlink_first(jh); in __buffer_unlink()
56 if (transaction->t_checkpoint_io_list == jh) { in __buffer_unlink()
57 transaction->t_checkpoint_io_list = jh->b_cpnext; in __buffer_unlink()
58 if (transaction->t_checkpoint_io_list == jh) in __buffer_unlink()
68 static inline void __buffer_relink_io(struct journal_head *jh) in __buffer_relink_io() argument
70 transaction_t *transaction = jh->b_cp_transaction; in __buffer_relink_io()
72 __buffer_unlink_first(jh); in __buffer_relink_io()
75 jh->b_cpnext = jh->b_cpprev = jh; in __buffer_relink_io()
77 jh->b_cpnext = transaction->t_checkpoint_io_list; in __buffer_relink_io()
78 jh->b_cpprev = transaction->t_checkpoint_io_list->b_cpprev; in __buffer_relink_io()
79 jh->b_cpprev->b_cpnext = jh; in __buffer_relink_io()
80 jh->b_cpnext->b_cpprev = jh; in __buffer_relink_io()
82 transaction->t_checkpoint_io_list = jh; in __buffer_relink_io()
93 static int __try_to_free_cp_buf(struct journal_head *jh) in __try_to_free_cp_buf() argument
96 struct buffer_head *bh = jh2bh(jh); in __try_to_free_cp_buf()
98 if (jh->b_jlist == BJ_None && !buffer_locked(bh) && in __try_to_free_cp_buf()
105 JBUFFER_TRACE(jh, "remove from checkpoint list"); in __try_to_free_cp_buf()
106 ret = __journal_remove_checkpoint(jh) + 1; in __try_to_free_cp_buf()
209 struct journal_head *jh; in __wait_cp_io() local
222 jh = transaction->t_checkpoint_io_list; in __wait_cp_io()
223 bh = jh2bh(jh); in __wait_cp_io()
247 released = __journal_remove_checkpoint(jh); in __wait_cp_io()
287 static int __process_buffer(journal_t *journal, struct journal_head *jh, in __process_buffer() argument
290 struct buffer_head *bh = jh2bh(jh); in __process_buffer()
302 } else if (jh->b_transaction != NULL) { in __process_buffer()
303 transaction_t *t = jh->b_transaction; in __process_buffer()
316 J_ASSERT_JH(jh, !buffer_jbddirty(bh)); in __process_buffer()
318 __journal_remove_checkpoint(jh); in __process_buffer()
335 __buffer_relink_io(jh); in __process_buffer()
394 struct journal_head *jh; in log_do_checkpoint() local
400 jh = transaction->t_checkpoint_list; in log_do_checkpoint()
401 bh = jh2bh(jh); in log_do_checkpoint()
407 retry = __process_buffer(journal, jh, bhs,&batch_count); in log_do_checkpoint()
557 static int journal_clean_one_cp_list(struct journal_head *jh, int *released) in journal_clean_one_cp_list() argument
560 struct journal_head *next_jh = jh; in journal_clean_one_cp_list()
564 if (!jh) in journal_clean_one_cp_list()
567 last_jh = jh->b_cpprev; in journal_clean_one_cp_list()
569 jh = next_jh; in journal_clean_one_cp_list()
570 next_jh = jh->b_cpnext; in journal_clean_one_cp_list()
572 if (jbd_trylock_bh_state(jh2bh(jh))) { in journal_clean_one_cp_list()
573 ret = __try_to_free_cp_buf(jh); in journal_clean_one_cp_list()
590 } while (jh != last_jh); in journal_clean_one_cp_list()
665 int __journal_remove_checkpoint(struct journal_head *jh) in __journal_remove_checkpoint() argument
671 JBUFFER_TRACE(jh, "entry"); in __journal_remove_checkpoint()
673 if ((transaction = jh->b_cp_transaction) == NULL) { in __journal_remove_checkpoint()
674 JBUFFER_TRACE(jh, "not on transaction"); in __journal_remove_checkpoint()
679 JBUFFER_TRACE(jh, "removing from transaction"); in __journal_remove_checkpoint()
680 __buffer_unlink(jh); in __journal_remove_checkpoint()
681 jh->b_cp_transaction = NULL; in __journal_remove_checkpoint()
682 journal_put_journal_head(jh); in __journal_remove_checkpoint()
721 void __journal_insert_checkpoint(struct journal_head *jh, in __journal_insert_checkpoint() argument
724 JBUFFER_TRACE(jh, "entry"); in __journal_insert_checkpoint()
725 J_ASSERT_JH(jh, buffer_dirty(jh2bh(jh)) || buffer_jbddirty(jh2bh(jh))); in __journal_insert_checkpoint()
726 J_ASSERT_JH(jh, jh->b_cp_transaction == NULL); in __journal_insert_checkpoint()
729 journal_grab_journal_head(jh2bh(jh)); in __journal_insert_checkpoint()
730 jh->b_cp_transaction = transaction; in __journal_insert_checkpoint()
733 jh->b_cpnext = jh->b_cpprev = jh; in __journal_insert_checkpoint()
735 jh->b_cpnext = transaction->t_checkpoint_list; in __journal_insert_checkpoint()
736 jh->b_cpprev = transaction->t_checkpoint_list->b_cpprev; in __journal_insert_checkpoint()
737 jh->b_cpprev->b_cpnext = jh; in __journal_insert_checkpoint()
738 jh->b_cpnext->b_cpprev = jh; in __journal_insert_checkpoint()
740 transaction->t_checkpoint_list = jh; in __journal_insert_checkpoint()