Lines Matching refs:jl
87 struct reiserfs_journal_list *jl, int flushall);
89 struct reiserfs_journal_list *jl, int flushall);
96 struct reiserfs_journal_list *jl);
311 *jl) in get_list_bitmap()
335 jb->journal_list = jl; in get_list_bitmap()
543 static inline void get_journal_list(struct reiserfs_journal_list *jl) in get_journal_list() argument
545 jl->j_refcount++; in get_journal_list()
549 struct reiserfs_journal_list *jl) in put_journal_list() argument
551 if (jl->j_refcount < 1) { in put_journal_list()
553 jl->j_trans_id, jl->j_refcount); in put_journal_list()
555 if (--jl->j_refcount == 0) in put_journal_list()
556 kfree(jl); in put_journal_list()
565 struct reiserfs_journal_list *jl) in cleanup_freed_for_journal_list() argument
568 struct reiserfs_list_bitmap *jb = jl->j_list_bitmap; in cleanup_freed_for_journal_list()
572 jl->j_list_bitmap->journal_list = NULL; in cleanup_freed_for_journal_list()
573 jl->j_list_bitmap = NULL; in cleanup_freed_for_journal_list()
581 struct reiserfs_journal_list *jl; in journal_list_still_alive() local
584 jl = JOURNAL_LIST_ENTRY(entry->next); in journal_list_still_alive()
585 if (jl->j_trans_id <= trans_id) { in journal_list_still_alive()
770 jh->jl = j->j_current_jl; in __add_jh()
772 list_add_tail(&jh->list, &jh->jl->j_tail_bh_list); in __add_jh()
774 list_add_tail(&jh->list, &jh->jl->j_bh_list); in __add_jh()
792 struct reiserfs_journal_list *jl, in write_ordered_buffers() argument
882 struct reiserfs_journal_list *jl) in flush_older_commits() argument
888 unsigned int trans_id = jl->j_trans_id; in flush_older_commits()
895 first_jl = jl; in flush_older_commits()
896 entry = jl->j_list.prev; in flush_older_commits()
908 if (first_jl == jl) { in flush_older_commits()
971 struct reiserfs_journal_list *jl, int flushall) in flush_commit_list() argument
976 unsigned int trans_id = jl->j_trans_id; in flush_commit_list()
984 if (atomic_read(&jl->j_older_commits_done)) { in flush_commit_list()
992 BUG_ON(jl->j_len <= 0); in flush_commit_list()
995 get_journal_list(jl); in flush_commit_list()
997 if (flush_older_commits(s, jl) == 1) { in flush_commit_list()
1007 reiserfs_mutex_lock_safe(&jl->j_commit_mutex, s); in flush_commit_list()
1010 mutex_unlock(&jl->j_commit_mutex); in flush_commit_list()
1013 BUG_ON(jl->j_trans_id == 0); in flush_commit_list()
1016 if (atomic_read(&jl->j_commit_left) <= 0) { in flush_commit_list()
1018 atomic_set(&jl->j_older_commits_done, 1); in flush_commit_list()
1020 mutex_unlock(&jl->j_commit_mutex); in flush_commit_list()
1024 if (!list_empty(&jl->j_bh_list)) { in flush_commit_list()
1033 journal, jl, &jl->j_bh_list); in flush_commit_list()
1038 BUG_ON(!list_empty(&jl->j_bh_list)); in flush_commit_list()
1047 write_len = jl->j_len + 1; in flush_commit_list()
1051 bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) + (jl->j_start + i) % in flush_commit_list()
1066 for (i = 0; i < (jl->j_len + 1); i++) { in flush_commit_list()
1068 (jl->j_start + i) % SB_ONDISK_JOURNAL_SIZE(s); in flush_commit_list()
1095 atomic_dec(&jl->j_commit_left); in flush_commit_list()
1098 BUG_ON(atomic_read(&jl->j_commit_left) != 1); in flush_commit_list()
1107 if (buffer_dirty(jl->j_commit_bh)) in flush_commit_list()
1109 mark_buffer_dirty(jl->j_commit_bh) ; in flush_commit_list()
1112 __sync_dirty_buffer(jl->j_commit_bh, in flush_commit_list()
1115 sync_dirty_buffer(jl->j_commit_bh); in flush_commit_list()
1124 if (unlikely(!buffer_uptodate(jl->j_commit_bh))) { in flush_commit_list()
1130 bforget(jl->j_commit_bh); in flush_commit_list()
1132 (jl->j_trans_id - journal->j_last_commit_id) != 1) { in flush_commit_list()
1134 journal->j_last_commit_id, jl->j_trans_id); in flush_commit_list()
1136 journal->j_last_commit_id = jl->j_trans_id; in flush_commit_list()
1142 cleanup_freed_for_journal_list(s, jl); in flush_commit_list()
1148 dirty_one_transaction(s, jl); in flush_commit_list()
1149 atomic_dec(&jl->j_commit_left); in flush_commit_list()
1152 atomic_set(&jl->j_older_commits_done, 1); in flush_commit_list()
1154 mutex_unlock(&jl->j_commit_mutex); in flush_commit_list()
1156 put_journal_list(s, jl); in flush_commit_list()
1197 struct reiserfs_journal_list *jl, in remove_all_from_journal_list() argument
1202 cn = jl->j_realblock; in remove_all_from_journal_list()
1218 jl, cn->blocknr, 1); in remove_all_from_journal_list()
1224 jl->j_realblock = NULL; in remove_all_from_journal_list()
1298 struct reiserfs_journal_list *jl) in flush_older_journal_lists() argument
1303 unsigned int trans_id = jl->j_trans_id; in flush_older_journal_lists()
1327 struct reiserfs_journal_list *jl) in del_from_work_list() argument
1330 if (!list_empty(&jl->j_working_list)) { in del_from_work_list()
1331 list_del_init(&jl->j_working_list); in del_from_work_list()
1347 struct reiserfs_journal_list *jl, int flushall) in flush_journal_list() argument
1355 unsigned long j_len_saved = jl->j_len; in flush_journal_list()
1377 j_len_saved, jl->j_trans_id); in flush_journal_list()
1382 if (atomic_read(&jl->j_nonzerolen) <= 0 && in flush_journal_list()
1383 atomic_read(&jl->j_commit_left) <= 0) { in flush_journal_list()
1391 flush_commit_list(s, jl, 1); in flush_journal_list()
1393 if (!(jl->j_state & LIST_DIRTY) in flush_journal_list()
1398 if (atomic_read(&jl->j_nonzerolen) <= 0 && in flush_journal_list()
1399 atomic_read(&jl->j_commit_left) <= 0) { in flush_journal_list()
1411 cn = jl->j_realblock; in flush_journal_list()
1425 if (!(jl->j_state & LIST_DIRTY)) in flush_journal_list()
1522 cn = jl->j_realblock; in flush_journal_list()
1575 flush_older_journal_lists(s, jl); in flush_journal_list()
1591 (jl->j_start + jl->j_len + in flush_journal_list()
1593 jl->j_trans_id); in flush_journal_list()
1599 remove_all_from_journal_list(s, jl, 0); in flush_journal_list()
1600 list_del_init(&jl->j_list); in flush_journal_list()
1602 del_from_work_list(s, jl); in flush_journal_list()
1605 (jl->j_trans_id - journal->j_last_flush_id) != 1) { in flush_journal_list()
1607 journal->j_last_flush_id, jl->j_trans_id); in flush_journal_list()
1609 journal->j_last_flush_id = jl->j_trans_id; in flush_journal_list()
1615 jl->j_len = 0; in flush_journal_list()
1616 atomic_set(&jl->j_nonzerolen, 0); in flush_journal_list()
1617 jl->j_start = 0; in flush_journal_list()
1618 jl->j_realblock = NULL; in flush_journal_list()
1619 jl->j_commit_bh = NULL; in flush_journal_list()
1620 jl->j_trans_id = 0; in flush_journal_list()
1621 jl->j_state = 0; in flush_journal_list()
1622 put_journal_list(s, jl); in flush_journal_list()
1629 struct reiserfs_journal_list *jl, in write_one_transaction() argument
1635 jl->j_state |= LIST_TOUCHED; in write_one_transaction()
1636 del_from_work_list(s, jl); in write_one_transaction()
1637 if (jl->j_len == 0 || atomic_read(&jl->j_nonzerolen) == 0) { in write_one_transaction()
1641 cn = jl->j_realblock; in write_one_transaction()
1681 struct reiserfs_journal_list *jl) in dirty_one_transaction() argument
1686 jl->j_state |= LIST_DIRTY; in dirty_one_transaction()
1687 cn = jl->j_realblock; in dirty_one_transaction()
1716 struct reiserfs_journal_list *jl, in kupdate_transactions() argument
1724 unsigned int orig_trans_id = jl->j_trans_id; in kupdate_transactions()
1742 if (jl->j_len == 0 || (jl->j_state & LIST_TOUCHED) || in kupdate_transactions()
1743 atomic_read(&jl->j_commit_left) in kupdate_transactions()
1744 || !(jl->j_state & LIST_DIRTY)) { in kupdate_transactions()
1745 del_from_work_list(s, jl); in kupdate_transactions()
1748 ret = write_one_transaction(s, jl, &chunk); in kupdate_transactions()
1754 entry = jl->j_list.next; in kupdate_transactions()
1760 jl = JOURNAL_LIST_ENTRY(entry); in kupdate_transactions()
1763 if (jl->j_trans_id <= orig_trans_id) in kupdate_transactions()
1786 struct reiserfs_journal_list *jl) in flush_used_journal_lists() argument
1797 flush_jl = tjl = jl; in flush_used_journal_lists()
1805 tjl->j_trans_id < jl->j_trans_id) { in flush_used_journal_lists()
1818 get_journal_list(jl); in flush_used_journal_lists()
1826 if (flush_jl != jl) in flush_used_journal_lists()
1827 kupdate_transactions(s, jl, &tjl, &trans_id, len, i); in flush_used_journal_lists()
1831 put_journal_list(s, jl); in flush_used_journal_lists()
1841 struct reiserfs_journal_list *jl, in remove_journal_hash() argument
1854 && (jl == NULL || jl == cur->jlist) in remove_journal_hash()
2570 struct reiserfs_journal_list *jl; in alloc_journal_list() local
2571 jl = kzalloc(sizeof(struct reiserfs_journal_list), in alloc_journal_list()
2573 INIT_LIST_HEAD(&jl->j_list); in alloc_journal_list()
2574 INIT_LIST_HEAD(&jl->j_working_list); in alloc_journal_list()
2575 INIT_LIST_HEAD(&jl->j_tail_bh_list); in alloc_journal_list()
2576 INIT_LIST_HEAD(&jl->j_bh_list); in alloc_journal_list()
2577 mutex_init(&jl->j_commit_mutex); in alloc_journal_list()
2579 get_journal_list(jl); in alloc_journal_list()
2580 return jl; in alloc_journal_list()
2719 struct reiserfs_journal_list *jl; in journal_init() local
2881 jl = journal->j_current_jl; in journal_init()
2889 jl->j_list_bitmap = get_list_bitmap(sb, jl); in journal_init()
2891 if (!jl->j_list_bitmap) { in journal_init()
3546 struct reiserfs_journal_list *jl; in flush_async_commits() local
3553 jl = JOURNAL_LIST_ENTRY(entry); in flush_async_commits()
3554 flush_commit_list(sb, jl, 1); in flush_async_commits()
3623 struct reiserfs_journal_list *jl; in check_journal_end() local
3660 jl = journal->j_current_jl; in check_journal_end()
3661 trans_id = jl->j_trans_id; in check_journal_end()
3663 jl->j_state |= LIST_COMMIT_PENDING; in check_journal_end()
3691 flush_commit_list(sb, jl, 1); in check_journal_end()
3844 struct reiserfs_journal_list *jl) in __commit_trans_jl() argument
3856 jl = journal->j_current_jl; in __commit_trans_jl()
3896 if (atomic_read(&jl->j_commit_left) > 1) in __commit_trans_jl()
3898 flush_commit_list(sb, jl, 1); in __commit_trans_jl()
3910 struct reiserfs_journal_list *jl = REISERFS_I(inode)->i_jl; in reiserfs_commit_for_inode() local
3916 if (!id || !jl) { in reiserfs_commit_for_inode()
3922 return __commit_trans_jl(inode, id, jl); in reiserfs_commit_for_inode()
3999 struct reiserfs_journal_list *jl, *temp_jl; in do_journal_end() local
4100 jl = journal->j_current_jl; in do_journal_end()
4108 reiserfs_mutex_lock_safe(&jl->j_commit_mutex, sb); in do_journal_end()
4111 commit_trans_id = jl->j_trans_id; in do_journal_end()
4113 atomic_set(&jl->j_older_commits_done, 0); in do_journal_end()
4114 jl->j_trans_id = journal->j_trans_id; in do_journal_end()
4115 jl->j_timestamp = journal->j_trans_start_time; in do_journal_end()
4116 jl->j_commit_bh = c_bh; in do_journal_end()
4117 jl->j_start = journal->j_start; in do_journal_end()
4118 jl->j_len = journal->j_len; in do_journal_end()
4119 atomic_set(&jl->j_nonzerolen, journal->j_len); in do_journal_end()
4120 atomic_set(&jl->j_commit_left, journal->j_len + 2); in do_journal_end()
4121 jl->j_realblock = NULL; in do_journal_end()
4137 jl->j_realblock = jl_cn; in do_journal_end()
4160 jl_cn->jlist = jl; in do_journal_end()
4247 list_add_tail(&jl->j_list, &journal->j_journal_list); in do_journal_end()
4248 list_add_tail(&jl->j_working_list, &journal->j_working_list); in do_journal_end()
4284 if (!list_empty(&jl->j_tail_bh_list)) { in do_journal_end()
4287 journal, jl, &jl->j_tail_bh_list); in do_journal_end()
4290 BUG_ON(!list_empty(&jl->j_tail_bh_list)); in do_journal_end()
4291 mutex_unlock(&jl->j_commit_mutex); in do_journal_end()
4302 flush_commit_list(sb, jl, 1); in do_journal_end()
4303 flush_journal_list(sb, jl, 1); in do_journal_end()
4304 } else if (!(jl->j_state & LIST_COMMIT_PENDING)) { in do_journal_end()
4374 flush_commit_list(sb, jl, 1); in do_journal_end()