• Home
  • Raw
  • Download

Lines Matching refs:th

91 static int journal_join(struct reiserfs_transaction_handle *th,
109 static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
1904 static int do_journal_release(struct reiserfs_transaction_handle *th, in do_journal_release() argument
1916 BUG_ON(!th->t_trans_id); in do_journal_release()
1917 do_journal_end(th, FLUSH_ALL); in do_journal_release()
1968 int journal_release(struct reiserfs_transaction_handle *th, in journal_release() argument
1971 return do_journal_release(th, sb, 0); in journal_release()
1975 int journal_release_error(struct reiserfs_transaction_handle *th, in journal_release_error() argument
1978 return do_journal_release(th, sb, 1); in journal_release_error()
2919 int journal_transaction_should_end(struct reiserfs_transaction_handle *th, in journal_transaction_should_end() argument
2922 struct reiserfs_journal *journal = SB_JOURNAL(th->t_super); in journal_transaction_should_end()
2925 BUG_ON(!th->t_trans_id); in journal_transaction_should_end()
2926 if (th->t_refcount > 1) in journal_transaction_should_end()
2937 th->t_blocks_allocated += new_alloc ; in journal_transaction_should_end()
2942 void reiserfs_block_writes(struct reiserfs_transaction_handle *th) in reiserfs_block_writes() argument
2944 struct reiserfs_journal *journal = SB_JOURNAL(th->t_super); in reiserfs_block_writes()
2945 BUG_ON(!th->t_trans_id); in reiserfs_block_writes()
3028 static int do_journal_begin_r(struct reiserfs_transaction_handle *th, in do_journal_begin_r() argument
3045 th->t_refcount = 1; in do_journal_begin_r()
3046 th->t_super = sb; in do_journal_begin_r()
3132 th->t_blocks_logged = 0; in do_journal_begin_r()
3133 th->t_blocks_allocated = nblocks; in do_journal_begin_r()
3134 th->t_trans_id = journal->j_trans_id; in do_journal_begin_r()
3136 INIT_LIST_HEAD(&th->t_list); in do_journal_begin_r()
3140 memset(th, 0, sizeof(*th)); in do_journal_begin_r()
3146 th->t_super = sb; in do_journal_begin_r()
3156 struct reiserfs_transaction_handle *th; in reiserfs_persistent_transaction() local
3163 th = current->journal_info; in reiserfs_persistent_transaction()
3164 th->t_refcount++; in reiserfs_persistent_transaction()
3165 BUG_ON(th->t_refcount < 2); in reiserfs_persistent_transaction()
3167 return th; in reiserfs_persistent_transaction()
3169 th = kmalloc(sizeof(struct reiserfs_transaction_handle), GFP_NOFS); in reiserfs_persistent_transaction()
3170 if (!th) in reiserfs_persistent_transaction()
3172 ret = journal_begin(th, s, nblocks); in reiserfs_persistent_transaction()
3174 kfree(th); in reiserfs_persistent_transaction()
3179 return th; in reiserfs_persistent_transaction()
3182 int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th) in reiserfs_end_persistent_transaction() argument
3184 struct super_block *s = th->t_super; in reiserfs_end_persistent_transaction()
3186 if (th->t_trans_id) in reiserfs_end_persistent_transaction()
3187 ret = journal_end(th); in reiserfs_end_persistent_transaction()
3190 if (th->t_refcount == 0) { in reiserfs_end_persistent_transaction()
3192 kfree(th); in reiserfs_end_persistent_transaction()
3197 static int journal_join(struct reiserfs_transaction_handle *th, in journal_join() argument
3206 th->t_handle_save = cur_th; in journal_join()
3208 return do_journal_begin_r(th, sb, 1, JBEGIN_JOIN); in journal_join()
3211 int journal_join_abort(struct reiserfs_transaction_handle *th, in journal_join_abort() argument
3220 th->t_handle_save = cur_th; in journal_join_abort()
3222 return do_journal_begin_r(th, sb, 1, JBEGIN_ABORT); in journal_join_abort()
3225 int journal_begin(struct reiserfs_transaction_handle *th, in journal_begin() argument
3231 th->t_handle_save = NULL; in journal_begin()
3237 memcpy(th, cur_th, sizeof(*th)); in journal_begin()
3238 if (th->t_refcount <= 1) in journal_begin()
3251 th->t_handle_save = current->journal_info; in journal_begin()
3252 current->journal_info = th; in journal_begin()
3255 current->journal_info = th; in journal_begin()
3257 ret = do_journal_begin_r(th, sb, nblocks, JBEGIN_REG); in journal_begin()
3258 BUG_ON(current->journal_info != th); in journal_begin()
3265 current->journal_info = th->t_handle_save; in journal_begin()
3267 BUG_ON(!th->t_refcount); in journal_begin()
3282 int journal_mark_dirty(struct reiserfs_transaction_handle *th, in journal_mark_dirty() argument
3285 struct super_block *sb = th->t_super; in journal_mark_dirty()
3290 BUG_ON(!th->t_trans_id); in journal_mark_dirty()
3293 if (th->t_trans_id != journal->j_trans_id) { in journal_mark_dirty()
3294 reiserfs_panic(th->t_super, "journal-1577", in journal_mark_dirty()
3296 th->t_trans_id, journal->j_trans_id); in journal_mark_dirty()
3335 reiserfs_panic(th->t_super, "journal-1413", in journal_mark_dirty()
3359 if (th->t_blocks_logged == th->t_blocks_allocated) { in journal_mark_dirty()
3360 th->t_blocks_allocated += JOURNAL_PER_BALANCE_CNT; in journal_mark_dirty()
3363 th->t_blocks_logged++; in journal_mark_dirty()
3389 int journal_end(struct reiserfs_transaction_handle *th) in journal_end() argument
3391 struct super_block *sb = th->t_super; in journal_end()
3392 if (!current->journal_info && th->t_refcount > 1) in journal_end()
3394 "th NULL, refcount %d", th->t_refcount); in journal_end()
3396 if (!th->t_trans_id) { in journal_end()
3401 th->t_refcount--; in journal_end()
3402 if (th->t_refcount > 0) { in journal_end()
3410 BUG_ON(cur_th->t_super != th->t_super); in journal_end()
3412 if (th != cur_th) { in journal_end()
3413 memcpy(current->journal_info, th, sizeof(*th)); in journal_end()
3414 th->t_trans_id = 0; in journal_end()
3418 return do_journal_end(th, 0); in journal_end()
3526 int journal_end_sync(struct reiserfs_transaction_handle *th) in journal_end_sync() argument
3528 struct super_block *sb = th->t_super; in journal_end_sync()
3531 BUG_ON(!th->t_trans_id); in journal_end_sync()
3533 BUG_ON(th->t_refcount > 1); in journal_end_sync()
3537 journal_mark_dirty(th, SB_BUFFER_WITH_SB(sb)); in journal_end_sync()
3539 return do_journal_end(th, COMMIT_NOW | WAIT); in journal_end_sync()
3568 struct reiserfs_transaction_handle th; in reiserfs_flush_old_commits() local
3587 if (!journal_join(&th, sb)) { in reiserfs_flush_old_commits()
3591 journal_mark_dirty(&th, SB_BUFFER_WITH_SB(sb)); in reiserfs_flush_old_commits()
3598 do_journal_end(&th, COMMIT_NOW | WAIT); in reiserfs_flush_old_commits()
3618 static int check_journal_end(struct reiserfs_transaction_handle *th, int flags) in check_journal_end() argument
3626 struct super_block *sb = th->t_super; in check_journal_end()
3629 BUG_ON(!th->t_trans_id); in check_journal_end()
3631 if (th->t_trans_id != journal->j_trans_id) { in check_journal_end()
3632 reiserfs_panic(th->t_super, "journal-1577", in check_journal_end()
3634 th->t_trans_id, journal->j_trans_id); in check_journal_end()
3637 journal->j_len_alloc -= (th->t_blocks_allocated - th->t_blocks_logged); in check_journal_end()
3743 int journal_mark_freed(struct reiserfs_transaction_handle *th, in journal_mark_freed() argument
3751 BUG_ON(!th->t_trans_id); in journal_mark_freed()
3848 struct reiserfs_transaction_handle th; in __commit_trans_jl() local
3868 ret = journal_begin(&th, sb, 1); in __commit_trans_jl()
3876 journal_mark_dirty(&th, SB_BUFFER_WITH_SB(sb)); in __commit_trans_jl()
3877 ret = journal_end(&th); in __commit_trans_jl()
3881 ret = journal_end_sync(&th); in __commit_trans_jl()
3987 static int do_journal_end(struct reiserfs_transaction_handle *th, int flags) in do_journal_end() argument
3989 struct super_block *sb = th->t_super; in do_journal_end()
4008 BUG_ON(th->t_refcount > 1); in do_journal_end()
4009 BUG_ON(!th->t_trans_id); in do_journal_end()
4010 BUG_ON(!th->t_super); in do_journal_end()
4016 if (th->t_trans_id == ~0U) in do_journal_end()
4021 current->journal_info = th->t_handle_save; in do_journal_end()
4026 journal_mark_dirty(th, SB_BUFFER_WITH_SB(sb)); in do_journal_end()
4044 if (!check_journal_end(th, flags)) { in do_journal_end()
4068 current->journal_info = th; in do_journal_end()
4069 th->t_refcount++; in do_journal_end()
4072 reiserfs_discard_all_prealloc(th); in do_journal_end()
4074 th->t_refcount--; in do_journal_end()
4075 current->journal_info = th->t_handle_save; in do_journal_end()
4381 memset(th, 0, sizeof(*th)); in do_journal_end()
4387 th->t_super = sb; in do_journal_end()