Lines Matching refs:handle

321 static int ext4_alloc_branch(handle_t *handle,  in ext4_alloc_branch()  argument
333 new_blocks[i] = ext4_mb_new_blocks(handle, ar, &err); in ext4_alloc_branch()
335 ar->goal = new_blocks[i] = ext4_new_meta_blocks(handle, in ext4_alloc_branch()
354 err = ext4_journal_get_create_access(handle, bh); in ext4_alloc_branch()
374 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
388 ext4_forget(handle, 1, ar->inode, branch[i].bh, in ext4_alloc_branch()
390 ext4_free_blocks(handle, ar->inode, NULL, new_blocks[i], in ext4_alloc_branch()
411 static int ext4_splice_branch(handle_t *handle, in ext4_splice_branch() argument
426 err = ext4_journal_get_write_access(handle, where->bh); in ext4_splice_branch()
457 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
464 ext4_mark_inode_dirty(handle, ar->inode); in ext4_splice_branch()
476 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
479 ext4_free_blocks(handle, ar->inode, NULL, le32_to_cpu(where[num].key), in ext4_splice_branch()
513 int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, in ext4_ind_map_blocks() argument
530 J_ASSERT(handle != NULL || (flags & EXT4_GET_BLOCKS_CREATE) == 0); in ext4_ind_map_blocks()
595 err = ext4_alloc_branch(handle, &ar, indirect_blks, in ext4_ind_map_blocks()
606 err = ext4_splice_branch(handle, &ar, partial, indirect_blks); in ext4_ind_map_blocks()
612 ext4_update_inode_fsync_trans(handle, inode, 1); in ext4_ind_map_blocks()
651 handle_t *handle; in ext4_ind_direct_IO() local
662 handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); in ext4_ind_direct_IO()
663 if (IS_ERR(handle)) { in ext4_ind_direct_IO()
664 ret = PTR_ERR(handle); in ext4_ind_direct_IO()
667 ret = ext4_orphan_add(handle, inode); in ext4_ind_direct_IO()
669 ext4_journal_stop(handle); in ext4_ind_direct_IO()
674 ext4_journal_stop(handle); in ext4_ind_direct_IO()
725 handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); in ext4_ind_direct_IO()
726 if (IS_ERR(handle)) { in ext4_ind_direct_IO()
730 ret = PTR_ERR(handle); in ext4_ind_direct_IO()
737 ext4_orphan_del(handle, inode); in ext4_ind_direct_IO()
750 ext4_mark_inode_dirty(handle, inode); in ext4_ind_direct_IO()
753 err = ext4_journal_stop(handle); in ext4_ind_direct_IO()
813 static int try_to_extend_transaction(handle_t *handle, struct inode *inode) in try_to_extend_transaction() argument
815 if (!ext4_handle_valid(handle)) in try_to_extend_transaction()
817 if (ext4_handle_has_enough_credits(handle, EXT4_RESERVE_TRANS_BLOCKS+1)) in try_to_extend_transaction()
819 if (!ext4_journal_extend(handle, ext4_blocks_for_truncate(inode))) in try_to_extend_transaction()
932 static int ext4_clear_blocks(handle_t *handle, struct inode *inode, in ext4_clear_blocks() argument
955 if (try_to_extend_transaction(handle, inode)) { in ext4_clear_blocks()
958 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_clear_blocks()
962 err = ext4_mark_inode_dirty(handle, inode); in ext4_clear_blocks()
965 err = ext4_truncate_restart_trans(handle, inode, in ext4_clear_blocks()
971 err = ext4_journal_get_write_access(handle, bh); in ext4_clear_blocks()
980 ext4_free_blocks(handle, inode, NULL, block_to_free, count, flags); in ext4_clear_blocks()
1006 static void ext4_free_data(handle_t *handle, struct inode *inode, in ext4_free_data() argument
1022 err = ext4_journal_get_write_access(handle, this_bh); in ext4_free_data()
1040 err = ext4_clear_blocks(handle, inode, this_bh, in ext4_free_data()
1053 err = ext4_clear_blocks(handle, inode, this_bh, block_to_free, in ext4_free_data()
1069 ext4_handle_dirty_metadata(handle, inode, this_bh); in ext4_free_data()
1091 static void ext4_free_branches(handle_t *handle, struct inode *inode, in ext4_free_branches() argument
1098 if (ext4_handle_is_aborted(handle)) in ext4_free_branches()
1134 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1156 if (ext4_handle_is_aborted(handle)) in ext4_free_branches()
1158 if (try_to_extend_transaction(handle, inode)) { in ext4_free_branches()
1159 ext4_mark_inode_dirty(handle, inode); in ext4_free_branches()
1160 ext4_truncate_restart_trans(handle, inode, in ext4_free_branches()
1175 ext4_free_blocks(handle, inode, NULL, nr, 1, in ext4_free_branches()
1185 if (!ext4_journal_get_write_access(handle, in ext4_free_branches()
1190 ext4_handle_dirty_metadata(handle, in ext4_free_branches()
1199 ext4_free_data(handle, inode, parent_bh, first, last); in ext4_free_branches()
1203 void ext4_ind_truncate(handle_t *handle, struct inode *inode) in ext4_ind_truncate() argument
1245 ext4_free_data(handle, inode, NULL, i_data+offsets[0], in ext4_ind_truncate()
1255 ext4_free_branches(handle, inode, NULL, in ext4_ind_truncate()
1265 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1272 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1285 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1); in ext4_ind_truncate()
1291 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2); in ext4_ind_truncate()
1297 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3); in ext4_ind_truncate()
1315 int ext4_ind_remove_space(handle_t *handle, struct inode *inode, in ext4_ind_remove_space() argument
1343 ext4_free_data(handle, inode, NULL, i_data + offsets[0], in ext4_ind_remove_space()
1359 ext4_free_data(handle, inode, NULL, i_data + offsets[0], in ext4_ind_remove_space()
1369 ext4_free_branches(handle, inode, NULL, in ext4_ind_remove_space()
1375 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1386 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1422 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1453 ext4_free_branches(handle, inode, NULL, in ext4_ind_remove_space()
1460 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1488 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1507 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1516 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1535 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1); in ext4_ind_remove_space()
1543 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2); in ext4_ind_remove_space()
1551 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3); in ext4_ind_remove_space()