Lines Matching refs:th
36 struct reiserfs_transaction_handle th; in reiserfs_evict_inode() local
57 if (journal_begin(&th, inode->i_sb, jbegin_count)) in reiserfs_evict_inode()
61 reiserfs_discard_prealloc(&th, inode); in reiserfs_evict_inode()
63 err = reiserfs_delete_object(&th, inode); in reiserfs_evict_inode()
76 if (journal_end(&th)) in reiserfs_evict_inode()
252 static int restart_transaction(struct reiserfs_transaction_handle *th, in restart_transaction() argument
255 struct super_block *s = th->t_super; in restart_transaction()
258 BUG_ON(!th->t_trans_id); in restart_transaction()
259 BUG_ON(!th->t_refcount); in restart_transaction()
264 if (th->t_refcount > 1) { in restart_transaction()
267 reiserfs_update_sd(th, inode); in restart_transaction()
268 err = journal_end(th); in restart_transaction()
270 err = journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6); in restart_transaction()
639 static inline int _allocate_block(struct reiserfs_transaction_handle *th, in _allocate_block() argument
645 BUG_ON(!th->t_trans_id); in _allocate_block()
649 return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr, in _allocate_block()
653 return reiserfs_new_unf_blocknrs(th, inode, allocated_block_nr, path, in _allocate_block()
671 struct reiserfs_transaction_handle *th = NULL; in reiserfs_get_block() local
732 th = reiserfs_persistent_transaction(inode->i_sb, jbegin_count); in reiserfs_get_block()
733 if (!th) { in reiserfs_get_block()
758 if (!th) { in reiserfs_get_block()
764 _allocate_block(th, block, inode, &allocated_block_nr, in reiserfs_get_block()
774 retval = restart_transaction(th, inode, &path); in reiserfs_get_block()
778 _allocate_block(th, block, inode, in reiserfs_get_block()
820 journal_mark_dirty(th, bh); in reiserfs_get_block()
821 reiserfs_update_sd(th, inode); in reiserfs_get_block()
826 if (!dangle && th) in reiserfs_get_block()
827 retval = reiserfs_end_persistent_transaction(th); in reiserfs_get_block()
839 if (!th) { in reiserfs_get_block()
876 reiserfs_insert_item(th, &path, &tmp_key, &tmp_ih, in reiserfs_get_block()
879 reiserfs_free_block(th, inode, in reiserfs_get_block()
918 BUG_ON(!th->t_refcount); in reiserfs_get_block()
919 if (th->t_refcount == 1) { in reiserfs_get_block()
922 (th); in reiserfs_get_block()
923 th = NULL; in reiserfs_get_block()
944 if (!th) in reiserfs_get_block()
945 th = reiserfs_persistent_transaction(inode->i_sb, 3); in reiserfs_get_block()
946 if (th) in reiserfs_get_block()
947 reiserfs_free_block(th, in reiserfs_get_block()
957 direct2indirect(th, inode, &path, unbh, in reiserfs_get_block()
961 reiserfs_free_block(th, inode, in reiserfs_get_block()
1077 reiserfs_paste_into_item(th, &path, &tmp_key, inode, in reiserfs_get_block()
1086 reiserfs_free_block(th, inode, in reiserfs_get_block()
1113 if (journal_transaction_should_end(th, th->t_blocks_allocated)) { in reiserfs_get_block()
1114 retval = restart_transaction(th, inode, &path); in reiserfs_get_block()
1135 reiserfs_free_block(th, inode, in reiserfs_get_block()
1149 if (th && (!dangle || (retval && !th->t_trans_id))) { in reiserfs_get_block()
1151 if (th->t_trans_id) in reiserfs_get_block()
1152 reiserfs_update_sd(th, inode); in reiserfs_get_block()
1153 err = reiserfs_end_persistent_transaction(th); in reiserfs_get_block()
1445 void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, in reiserfs_update_sd_size() argument
1455 BUG_ON(!th->t_trans_id); in reiserfs_update_sd_size()
1506 journal_mark_dirty(th, bh); in reiserfs_update_sd_size()
1771 struct reiserfs_transaction_handle th; in reiserfs_write_inode() local
1785 if (!journal_begin(&th, inode->i_sb, jbegin_count)) { in reiserfs_write_inode()
1786 reiserfs_update_sd(&th, inode); in reiserfs_write_inode()
1787 journal_end_sync(&th); in reiserfs_write_inode()
1798 static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, in reiserfs_new_directory() argument
1803 struct super_block *sb = th->t_super; in reiserfs_new_directory()
1809 BUG_ON(!th->t_trans_id); in reiserfs_new_directory()
1854 return reiserfs_insert_item(th, path, &key, ih, inode, body); in reiserfs_new_directory()
1861 static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, in reiserfs_new_symlink() argument
1867 struct super_block *sb = th->t_super; in reiserfs_new_symlink()
1871 BUG_ON(!th->t_trans_id); in reiserfs_new_symlink()
1897 return reiserfs_insert_item(th, path, &key, ih, inode, symname); in reiserfs_new_symlink()
1920 int reiserfs_new_inode(struct reiserfs_transaction_handle *th, in reiserfs_new_inode() argument
1938 BUG_ON(!th->t_trans_id); in reiserfs_new_inode()
1952 ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th)); in reiserfs_new_inode()
2059 th->displace_new_blocks = 1; in reiserfs_new_inode()
2062 reiserfs_insert_item(th, &path_to_key, &key, &ih, inode, in reiserfs_new_inode()
2070 if (!th->displace_new_blocks) in reiserfs_new_inode()
2076 reiserfs_new_directory(th, inode, &ih, &path_to_key, dir); in reiserfs_new_inode()
2084 reiserfs_new_symlink(th, inode, &ih, &path_to_key, symname, in reiserfs_new_inode()
2090 journal_end(th); in reiserfs_new_inode()
2105 retval = reiserfs_inherit_default_acl(th, dir, dentry, inode); in reiserfs_new_inode()
2110 journal_end(th); in reiserfs_new_inode()
2121 retval = reiserfs_security_write(th, inode, security); in reiserfs_new_inode()
2126 retval = journal_end(th); in reiserfs_new_inode()
2133 reiserfs_update_sd(th, inode); in reiserfs_new_inode()
2148 journal_end(th); in reiserfs_new_inode()
2161 th->t_trans_id = 0; /* so the caller can't use this handle later */ in reiserfs_new_inode()
2264 struct reiserfs_transaction_handle th; in reiserfs_truncate_file() local
2305 error = journal_begin(&th, inode->i_sb, in reiserfs_truncate_file()
2317 add_save_link(&th, inode, 1); in reiserfs_truncate_file()
2318 err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps); in reiserfs_truncate_file()
2319 error = journal_end(&th); in reiserfs_truncate_file()
2367 struct reiserfs_transaction_handle th; in map_block_for_writepage() local
2388 th.t_trans_id = 0; in map_block_for_writepage()
2435 retval = journal_begin(&th, inode->i_sb, jbegin_count); in map_block_for_writepage()
2459 journal_mark_dirty(&th, bh); in map_block_for_writepage()
2482 int err = journal_end(&th); in map_block_for_writepage()
2534 struct reiserfs_transaction_handle th; in reiserfs_write_full_page() local
2537 th.t_trans_id = 0; in reiserfs_write_full_page()
2612 error = journal_begin(&th, s, bh_per_page + 1); in reiserfs_write_full_page()
2629 journal_mark_dirty(&th, bh); in reiserfs_write_full_page()
2652 error = journal_end(&th); in reiserfs_write_full_page()
2784 struct reiserfs_transaction_handle *th; in reiserfs_write_begin() local
2785 th = (struct reiserfs_transaction_handle *)current-> in reiserfs_write_begin()
2787 BUG_ON(!th->t_refcount); in reiserfs_write_begin()
2788 BUG_ON(!th->t_trans_id); in reiserfs_write_begin()
2789 old_ref = th->t_refcount; in reiserfs_write_begin()
2790 th->t_refcount++; in reiserfs_write_begin()
2794 struct reiserfs_transaction_handle *th = current->journal_info; in reiserfs_write_begin() local
2808 if (th->t_refcount > old_ref) { in reiserfs_write_begin()
2810 th->t_refcount--; in reiserfs_write_begin()
2814 err = reiserfs_end_persistent_transaction(th); in reiserfs_write_begin()
2843 struct reiserfs_transaction_handle *th; in __reiserfs_write_begin() local
2844 th = (struct reiserfs_transaction_handle *)current-> in __reiserfs_write_begin()
2846 BUG_ON(!th->t_refcount); in __reiserfs_write_begin()
2847 BUG_ON(!th->t_trans_id); in __reiserfs_write_begin()
2848 old_ref = th->t_refcount; in __reiserfs_write_begin()
2849 th->t_refcount++; in __reiserfs_write_begin()
2854 struct reiserfs_transaction_handle *th = current->journal_info; in __reiserfs_write_begin() local
2868 if (th->t_refcount > old_ref) { in __reiserfs_write_begin()
2870 th->t_refcount--; in __reiserfs_write_begin()
2874 err = reiserfs_end_persistent_transaction(th); in __reiserfs_write_begin()
2897 struct reiserfs_transaction_handle *th; in reiserfs_write_end() local
2906 th = current->journal_info; in reiserfs_write_end()
2908 th = NULL; in reiserfs_write_end()
2959 if (th) { in reiserfs_write_end()
2966 ret = reiserfs_end_persistent_transaction(th); in reiserfs_write_end()
2985 if (th) { in reiserfs_write_end()
2987 reiserfs_update_sd(th, inode); in reiserfs_write_end()
2988 ret = reiserfs_end_persistent_transaction(th); in reiserfs_write_end()
3000 struct reiserfs_transaction_handle *th = NULL; in reiserfs_commit_write() local
3008 th = current->journal_info; in reiserfs_commit_write()
3048 if (th) { in reiserfs_commit_write()
3051 ret = reiserfs_end_persistent_transaction(th); in reiserfs_commit_write()
3060 if (th) { in reiserfs_commit_write()
3062 reiserfs_update_sd(th, inode); in reiserfs_commit_write()
3063 ret = reiserfs_end_persistent_transaction(th); in reiserfs_commit_write()
3323 struct reiserfs_transaction_handle th; in reiserfs_setattr() local
3325 err = journal_begin(&th, inode->i_sb, 4); in reiserfs_setattr()
3327 reiserfs_discard_prealloc(&th, inode); in reiserfs_setattr()
3328 err = journal_end(&th); in reiserfs_setattr()
3356 struct reiserfs_transaction_handle th; in reiserfs_setattr() local
3373 error = journal_begin(&th, inode->i_sb, jbegin_count); in reiserfs_setattr()
3380 journal_end(&th); in reiserfs_setattr()
3394 error = journal_end(&th); in reiserfs_setattr()