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()
631 static inline int _allocate_block(struct reiserfs_transaction_handle *th, in _allocate_block() argument
637 BUG_ON(!th->t_trans_id); in _allocate_block()
641 return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr, in _allocate_block()
645 return reiserfs_new_unf_blocknrs(th, inode, allocated_block_nr, path, in _allocate_block()
663 struct reiserfs_transaction_handle *th = NULL; in reiserfs_get_block() local
724 th = reiserfs_persistent_transaction(inode->i_sb, jbegin_count); in reiserfs_get_block()
725 if (!th) { in reiserfs_get_block()
750 if (!th) { in reiserfs_get_block()
756 _allocate_block(th, block, inode, &allocated_block_nr, in reiserfs_get_block()
766 retval = restart_transaction(th, inode, &path); in reiserfs_get_block()
770 _allocate_block(th, block, inode, in reiserfs_get_block()
812 journal_mark_dirty(th, bh); in reiserfs_get_block()
813 reiserfs_update_sd(th, inode); in reiserfs_get_block()
818 if (!dangle && th) in reiserfs_get_block()
819 retval = reiserfs_end_persistent_transaction(th); in reiserfs_get_block()
831 if (!th) { in reiserfs_get_block()
868 reiserfs_insert_item(th, &path, &tmp_key, &tmp_ih, in reiserfs_get_block()
871 reiserfs_free_block(th, inode, in reiserfs_get_block()
910 BUG_ON(!th->t_refcount); in reiserfs_get_block()
911 if (th->t_refcount == 1) { in reiserfs_get_block()
914 (th); in reiserfs_get_block()
915 th = NULL; in reiserfs_get_block()
936 if (!th) in reiserfs_get_block()
937 th = reiserfs_persistent_transaction(inode->i_sb, 3); in reiserfs_get_block()
938 if (th) in reiserfs_get_block()
939 reiserfs_free_block(th, in reiserfs_get_block()
949 direct2indirect(th, inode, &path, unbh, in reiserfs_get_block()
953 reiserfs_free_block(th, inode, in reiserfs_get_block()
1069 reiserfs_paste_into_item(th, &path, &tmp_key, inode, in reiserfs_get_block()
1078 reiserfs_free_block(th, inode, in reiserfs_get_block()
1105 if (journal_transaction_should_end(th, th->t_blocks_allocated)) { in reiserfs_get_block()
1106 retval = restart_transaction(th, inode, &path); in reiserfs_get_block()
1127 reiserfs_free_block(th, inode, in reiserfs_get_block()
1141 if (th && (!dangle || (retval && !th->t_trans_id))) { in reiserfs_get_block()
1143 if (th->t_trans_id) in reiserfs_get_block()
1144 reiserfs_update_sd(th, inode); in reiserfs_get_block()
1145 err = reiserfs_end_persistent_transaction(th); in reiserfs_get_block()
1437 void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th, in reiserfs_update_sd_size() argument
1447 BUG_ON(!th->t_trans_id); in reiserfs_update_sd_size()
1498 journal_mark_dirty(th, bh); in reiserfs_update_sd_size()
1763 struct reiserfs_transaction_handle th; in reiserfs_write_inode() local
1777 if (!journal_begin(&th, inode->i_sb, jbegin_count)) { in reiserfs_write_inode()
1778 reiserfs_update_sd(&th, inode); in reiserfs_write_inode()
1779 journal_end_sync(&th); in reiserfs_write_inode()
1790 static int reiserfs_new_directory(struct reiserfs_transaction_handle *th, in reiserfs_new_directory() argument
1795 struct super_block *sb = th->t_super; in reiserfs_new_directory()
1801 BUG_ON(!th->t_trans_id); in reiserfs_new_directory()
1846 return reiserfs_insert_item(th, path, &key, ih, inode, body); in reiserfs_new_directory()
1853 static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th, in reiserfs_new_symlink() argument
1859 struct super_block *sb = th->t_super; in reiserfs_new_symlink()
1863 BUG_ON(!th->t_trans_id); in reiserfs_new_symlink()
1889 return reiserfs_insert_item(th, path, &key, ih, inode, symname); in reiserfs_new_symlink()
1912 int reiserfs_new_inode(struct reiserfs_transaction_handle *th, in reiserfs_new_inode() argument
1930 BUG_ON(!th->t_trans_id); in reiserfs_new_inode()
1944 ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th)); in reiserfs_new_inode()
2051 th->displace_new_blocks = 1; in reiserfs_new_inode()
2054 reiserfs_insert_item(th, &path_to_key, &key, &ih, inode, in reiserfs_new_inode()
2062 if (!th->displace_new_blocks) in reiserfs_new_inode()
2068 reiserfs_new_directory(th, inode, &ih, &path_to_key, dir); in reiserfs_new_inode()
2076 reiserfs_new_symlink(th, inode, &ih, &path_to_key, symname, in reiserfs_new_inode()
2082 journal_end(th); in reiserfs_new_inode()
2097 retval = reiserfs_inherit_default_acl(th, dir, dentry, inode); in reiserfs_new_inode()
2102 journal_end(th); in reiserfs_new_inode()
2113 retval = reiserfs_security_write(th, inode, security); in reiserfs_new_inode()
2118 retval = journal_end(th); in reiserfs_new_inode()
2125 reiserfs_update_sd(th, inode); in reiserfs_new_inode()
2140 journal_end(th); in reiserfs_new_inode()
2153 th->t_trans_id = 0; /* so the caller can't use this handle later */ in reiserfs_new_inode()
2256 struct reiserfs_transaction_handle th; in reiserfs_truncate_file() local
2297 error = journal_begin(&th, inode->i_sb, in reiserfs_truncate_file()
2309 add_save_link(&th, inode, 1); in reiserfs_truncate_file()
2310 err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps); in reiserfs_truncate_file()
2311 error = journal_end(&th); in reiserfs_truncate_file()
2359 struct reiserfs_transaction_handle th; in map_block_for_writepage() local
2380 th.t_trans_id = 0; in map_block_for_writepage()
2427 retval = journal_begin(&th, inode->i_sb, jbegin_count); in map_block_for_writepage()
2451 journal_mark_dirty(&th, bh); in map_block_for_writepage()
2474 int err = journal_end(&th); in map_block_for_writepage()
2526 struct reiserfs_transaction_handle th; in reiserfs_write_full_page() local
2529 th.t_trans_id = 0; in reiserfs_write_full_page()
2602 error = journal_begin(&th, s, bh_per_page + 1); in reiserfs_write_full_page()
2619 journal_mark_dirty(&th, bh); in reiserfs_write_full_page()
2642 error = journal_end(&th); in reiserfs_write_full_page()
2767 struct reiserfs_transaction_handle *th; in reiserfs_write_begin() local
2768 th = (struct reiserfs_transaction_handle *)current-> in reiserfs_write_begin()
2770 BUG_ON(!th->t_refcount); in reiserfs_write_begin()
2771 BUG_ON(!th->t_trans_id); in reiserfs_write_begin()
2772 old_ref = th->t_refcount; in reiserfs_write_begin()
2773 th->t_refcount++; in reiserfs_write_begin()
2777 struct reiserfs_transaction_handle *th = current->journal_info; in reiserfs_write_begin() local
2791 if (th->t_refcount > old_ref) { in reiserfs_write_begin()
2793 th->t_refcount--; in reiserfs_write_begin()
2797 err = reiserfs_end_persistent_transaction(th); in reiserfs_write_begin()
2826 struct reiserfs_transaction_handle *th; in __reiserfs_write_begin() local
2827 th = (struct reiserfs_transaction_handle *)current-> in __reiserfs_write_begin()
2829 BUG_ON(!th->t_refcount); in __reiserfs_write_begin()
2830 BUG_ON(!th->t_trans_id); in __reiserfs_write_begin()
2831 old_ref = th->t_refcount; in __reiserfs_write_begin()
2832 th->t_refcount++; in __reiserfs_write_begin()
2837 struct reiserfs_transaction_handle *th = current->journal_info; in __reiserfs_write_begin() local
2851 if (th->t_refcount > old_ref) { in __reiserfs_write_begin()
2853 th->t_refcount--; in __reiserfs_write_begin()
2857 err = reiserfs_end_persistent_transaction(th); in __reiserfs_write_begin()
2880 struct reiserfs_transaction_handle *th; in reiserfs_write_end() local
2886 th = current->journal_info; in reiserfs_write_end()
2888 th = NULL; in reiserfs_write_end()
2939 if (th) { in reiserfs_write_end()
2946 ret = reiserfs_end_persistent_transaction(th); in reiserfs_write_end()
2965 if (th) { in reiserfs_write_end()
2967 reiserfs_update_sd(th, inode); in reiserfs_write_end()
2968 ret = reiserfs_end_persistent_transaction(th); in reiserfs_write_end()
2980 struct reiserfs_transaction_handle *th = NULL; in reiserfs_commit_write() local
2988 th = current->journal_info; in reiserfs_commit_write()
3028 if (th) { in reiserfs_commit_write()
3031 ret = reiserfs_end_persistent_transaction(th); in reiserfs_commit_write()
3040 if (th) { in reiserfs_commit_write()
3042 reiserfs_update_sd(th, inode); in reiserfs_commit_write()
3043 ret = reiserfs_end_persistent_transaction(th); in reiserfs_commit_write()
3308 struct reiserfs_transaction_handle th; in reiserfs_setattr() local
3310 err = journal_begin(&th, inode->i_sb, 4); in reiserfs_setattr()
3312 reiserfs_discard_prealloc(&th, inode); in reiserfs_setattr()
3313 err = journal_end(&th); in reiserfs_setattr()
3341 struct reiserfs_transaction_handle th; in reiserfs_setattr() local
3358 error = journal_begin(&th, inode->i_sb, jbegin_count); in reiserfs_setattr()
3365 journal_end(&th); in reiserfs_setattr()
3379 error = journal_end(&th); in reiserfs_setattr()