Lines Matching refs:th

36 	struct reiserfs_transaction_handle th;
57 if (journal_begin(&th, inode->i_sb, jbegin_count))
61 reiserfs_discard_prealloc(&th, inode);
63 err = reiserfs_delete_object(&th, inode);
76 if (journal_end(&th))
252 static int restart_transaction(struct reiserfs_transaction_handle *th,
255 struct super_block *s = th->t_super;
258 BUG_ON(!th->t_trans_id);
259 BUG_ON(!th->t_refcount);
264 if (th->t_refcount > 1) {
267 reiserfs_update_sd(th, inode);
268 err = journal_end(th);
270 err = journal_begin(th, s, JOURNAL_PER_BALANCE_CNT * 6);
279 * for 'block'-th logical block of file. When it hits direct item it
300 /* prepare the key to look for the 'block'-th block of file */
631 static inline int _allocate_block(struct reiserfs_transaction_handle *th,
637 BUG_ON(!th->t_trans_id);
641 return reiserfs_new_unf_blocknrs2(th, inode, allocated_block_nr,
645 return reiserfs_new_unf_blocknrs(th, inode, allocated_block_nr, path,
663 struct reiserfs_transaction_handle *th = NULL;
694 /* find number of block-th logical block of the file */
720 /* set the key of the first byte in the 'block'-th block of file */
724 th = reiserfs_persistent_transaction(inode->i_sb, jbegin_count);
725 if (!th) {
750 if (!th) {
756 _allocate_block(th, block, inode, &allocated_block_nr,
766 retval = restart_transaction(th, inode, &path);
770 _allocate_block(th, block, inode,
792 * 'block'-th block is in the file already (there is
812 journal_mark_dirty(th, bh);
813 reiserfs_update_sd(th, inode);
818 if (!dangle && th)
819 retval = reiserfs_end_persistent_transaction(th);
831 if (!th) {
838 * to append file with holes up to 'block'-th block converting
853 * we are going to add 'block'-th block to the file.
868 reiserfs_insert_item(th, &path, &tmp_key, &tmp_ih,
871 reiserfs_free_block(th, inode,
910 BUG_ON(!th->t_refcount);
911 if (th->t_refcount == 1) {
914 (th);
915 th = NULL;
936 if (!th)
937 th = reiserfs_persistent_transaction(inode->i_sb, 3);
938 if (th)
939 reiserfs_free_block(th,
949 direct2indirect(th, inode, &path, unbh,
953 reiserfs_free_block(th, inode,
999 * appending pointer to 'block'-th block use block,
1069 reiserfs_paste_into_item(th, &path, &tmp_key, inode,
1078 reiserfs_free_block(th, inode,
1105 if (journal_transaction_should_end(th, th->t_blocks_allocated)) {
1106 retval = restart_transaction(th, inode, &path);
1127 reiserfs_free_block(th, inode,
1141 if (th && (!dangle || (retval && !th->t_trans_id))) {
1143 if (th->t_trans_id)
1144 reiserfs_update_sd(th, inode);
1145 err = reiserfs_end_persistent_transaction(th);
1431 void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1441 BUG_ON(!th->t_trans_id);
1492 journal_mark_dirty(th, bh);
1757 struct reiserfs_transaction_handle th;
1771 if (!journal_begin(&th, inode->i_sb, jbegin_count)) {
1772 reiserfs_update_sd(&th, inode);
1773 journal_end_sync(&th);
1784 static int reiserfs_new_directory(struct reiserfs_transaction_handle *th,
1789 struct super_block *sb = th->t_super;
1795 BUG_ON(!th->t_trans_id);
1840 return reiserfs_insert_item(th, path, &key, ih, inode, body);
1847 static int reiserfs_new_symlink(struct reiserfs_transaction_handle *th,
1853 struct super_block *sb = th->t_super;
1857 BUG_ON(!th->t_trans_id);
1883 return reiserfs_insert_item(th, path, &key, ih, inode, symname);
1897 * @th: active transaction handle
1906 int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1924 BUG_ON(!th->t_trans_id);
1938 ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th));
2045 th->displace_new_blocks = 1;
2048 reiserfs_insert_item(th, &path_to_key, &key, &ih, inode,
2056 if (!th->displace_new_blocks)
2062 reiserfs_new_directory(th, inode, &ih, &path_to_key, dir);
2070 reiserfs_new_symlink(th, inode, &ih, &path_to_key, symname,
2076 journal_end(th);
2089 retval = reiserfs_inherit_default_acl(th, dir, dentry, inode);
2094 journal_end(th);
2105 retval = reiserfs_security_write(th, inode, security);
2110 retval = journal_end(th);
2117 reiserfs_update_sd(th, inode);
2132 journal_end(th);
2145 th->t_trans_id = 0; /* so the caller can't use this handle later */
2248 struct reiserfs_transaction_handle th;
2289 error = journal_begin(&th, inode->i_sb,
2301 add_save_link(&th, inode, 1);
2302 err2 = reiserfs_do_truncate(&th, inode, page, update_timestamps);
2303 error = journal_end(&th);
2351 struct reiserfs_transaction_handle th;
2372 th.t_trans_id = 0;
2419 retval = journal_begin(&th, inode->i_sb, jbegin_count);
2443 journal_mark_dirty(&th, bh);
2466 int err = journal_end(&th);
2518 struct reiserfs_transaction_handle th;
2521 th.t_trans_id = 0;
2593 error = journal_begin(&th, s, bh_per_page + 1);
2610 journal_mark_dirty(&th, bh);
2633 error = journal_end(&th);
2759 struct reiserfs_transaction_handle *th;
2760 th = (struct reiserfs_transaction_handle *)current->
2762 BUG_ON(!th->t_refcount);
2763 BUG_ON(!th->t_trans_id);
2764 old_ref = th->t_refcount;
2765 th->t_refcount++;
2769 struct reiserfs_transaction_handle *th = current->journal_info;
2783 if (th->t_refcount > old_ref) {
2785 th->t_refcount--;
2789 err = reiserfs_end_persistent_transaction(th);
2818 struct reiserfs_transaction_handle *th;
2819 th = (struct reiserfs_transaction_handle *)current->
2821 BUG_ON(!th->t_refcount);
2822 BUG_ON(!th->t_trans_id);
2823 old_ref = th->t_refcount;
2824 th->t_refcount++;
2829 struct reiserfs_transaction_handle *th = current->journal_info;
2843 if (th->t_refcount > old_ref) {
2845 th->t_refcount--;
2849 err = reiserfs_end_persistent_transaction(th);
2873 struct reiserfs_transaction_handle *th;
2879 th = current->journal_info;
2881 th = NULL;
2932 if (th) {
2939 ret = reiserfs_end_persistent_transaction(th);
2958 if (th) {
2960 reiserfs_update_sd(th, inode);
2961 ret = reiserfs_end_persistent_transaction(th);
2973 struct reiserfs_transaction_handle *th = NULL;
2981 th = current->journal_info;
3021 if (th) {
3024 ret = reiserfs_end_persistent_transaction(th);
3033 if (th) {
3035 reiserfs_update_sd(th, inode);
3036 ret = reiserfs_end_persistent_transaction(th);
3301 struct reiserfs_transaction_handle th;
3303 err = journal_begin(&th, inode->i_sb, 4);
3305 reiserfs_discard_prealloc(&th, inode);
3306 err = journal_end(&th);
3334 struct reiserfs_transaction_handle th;
3351 error = journal_begin(&th, inode->i_sb, jbegin_count);
3358 journal_end(&th);
3372 error = journal_end(&th);