Lines Matching refs:handle

322 static int ext4_alloc_branch(handle_t *handle,  in ext4_alloc_branch()  argument
334 new_blocks[i] = ext4_mb_new_blocks(handle, ar, &err); in ext4_alloc_branch()
336 ar->goal = new_blocks[i] = ext4_new_meta_blocks(handle, in ext4_alloc_branch()
355 err = ext4_journal_get_create_access(handle, bh); in ext4_alloc_branch()
375 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
389 ext4_forget(handle, 1, ar->inode, branch[i].bh, in ext4_alloc_branch()
391 ext4_free_blocks(handle, ar->inode, NULL, new_blocks[i], in ext4_alloc_branch()
412 static int ext4_splice_branch(handle_t *handle, in ext4_splice_branch() argument
427 err = ext4_journal_get_write_access(handle, where->bh); in ext4_splice_branch()
458 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
465 ext4_mark_inode_dirty(handle, ar->inode); in ext4_splice_branch()
477 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
480 ext4_free_blocks(handle, ar->inode, NULL, le32_to_cpu(where[num].key), in ext4_splice_branch()
514 int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, in ext4_ind_map_blocks() argument
531 J_ASSERT(handle != NULL || (flags & EXT4_GET_BLOCKS_CREATE) == 0); in ext4_ind_map_blocks()
597 err = ext4_alloc_branch(handle, &ar, indirect_blks, in ext4_ind_map_blocks()
608 err = ext4_splice_branch(handle, &ar, partial, indirect_blks); in ext4_ind_map_blocks()
614 ext4_update_inode_fsync_trans(handle, inode, 1); in ext4_ind_map_blocks()
653 handle_t *handle; in ext4_ind_direct_IO() local
664 handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); in ext4_ind_direct_IO()
665 if (IS_ERR(handle)) { in ext4_ind_direct_IO()
666 ret = PTR_ERR(handle); in ext4_ind_direct_IO()
669 ret = ext4_orphan_add(handle, inode); in ext4_ind_direct_IO()
671 ext4_journal_stop(handle); in ext4_ind_direct_IO()
676 ext4_journal_stop(handle); in ext4_ind_direct_IO()
727 handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); in ext4_ind_direct_IO()
728 if (IS_ERR(handle)) { in ext4_ind_direct_IO()
732 ret = PTR_ERR(handle); in ext4_ind_direct_IO()
739 ext4_orphan_del(handle, inode); in ext4_ind_direct_IO()
752 ext4_mark_inode_dirty(handle, inode); in ext4_ind_direct_IO()
755 err = ext4_journal_stop(handle); in ext4_ind_direct_IO()
815 static int try_to_extend_transaction(handle_t *handle, struct inode *inode) in try_to_extend_transaction() argument
817 if (!ext4_handle_valid(handle)) in try_to_extend_transaction()
819 if (ext4_handle_has_enough_credits(handle, EXT4_RESERVE_TRANS_BLOCKS+1)) in try_to_extend_transaction()
821 if (!ext4_journal_extend(handle, ext4_blocks_for_truncate(inode))) in try_to_extend_transaction()
934 static int ext4_clear_blocks(handle_t *handle, struct inode *inode, in ext4_clear_blocks() argument
957 if (try_to_extend_transaction(handle, inode)) { in ext4_clear_blocks()
960 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_clear_blocks()
964 err = ext4_mark_inode_dirty(handle, inode); in ext4_clear_blocks()
967 err = ext4_truncate_restart_trans(handle, inode, in ext4_clear_blocks()
973 err = ext4_journal_get_write_access(handle, bh); in ext4_clear_blocks()
982 ext4_free_blocks(handle, inode, NULL, block_to_free, count, flags); in ext4_clear_blocks()
1008 static void ext4_free_data(handle_t *handle, struct inode *inode, in ext4_free_data() argument
1024 err = ext4_journal_get_write_access(handle, this_bh); in ext4_free_data()
1042 err = ext4_clear_blocks(handle, inode, this_bh, in ext4_free_data()
1055 err = ext4_clear_blocks(handle, inode, this_bh, block_to_free, in ext4_free_data()
1071 ext4_handle_dirty_metadata(handle, inode, this_bh); in ext4_free_data()
1093 static void ext4_free_branches(handle_t *handle, struct inode *inode, in ext4_free_branches() argument
1100 if (ext4_handle_is_aborted(handle)) in ext4_free_branches()
1136 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1158 if (ext4_handle_is_aborted(handle)) in ext4_free_branches()
1160 if (try_to_extend_transaction(handle, inode)) { in ext4_free_branches()
1161 ext4_mark_inode_dirty(handle, inode); in ext4_free_branches()
1162 ext4_truncate_restart_trans(handle, inode, in ext4_free_branches()
1177 ext4_free_blocks(handle, inode, NULL, nr, 1, in ext4_free_branches()
1187 if (!ext4_journal_get_write_access(handle, in ext4_free_branches()
1192 ext4_handle_dirty_metadata(handle, in ext4_free_branches()
1201 ext4_free_data(handle, inode, parent_bh, first, last); in ext4_free_branches()
1205 void ext4_ind_truncate(handle_t *handle, struct inode *inode) in ext4_ind_truncate() argument
1247 ext4_free_data(handle, inode, NULL, i_data+offsets[0], in ext4_ind_truncate()
1257 ext4_free_branches(handle, inode, NULL, in ext4_ind_truncate()
1267 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1274 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1287 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1); in ext4_ind_truncate()
1293 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2); in ext4_ind_truncate()
1299 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3); in ext4_ind_truncate()
1317 int ext4_ind_remove_space(handle_t *handle, struct inode *inode, in ext4_ind_remove_space() argument
1345 ext4_free_data(handle, inode, NULL, i_data + offsets[0], in ext4_ind_remove_space()
1361 ext4_free_data(handle, inode, NULL, i_data + offsets[0], in ext4_ind_remove_space()
1371 ext4_free_branches(handle, inode, NULL, in ext4_ind_remove_space()
1377 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1388 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1424 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1455 ext4_free_branches(handle, inode, NULL, in ext4_ind_remove_space()
1462 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1490 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1509 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1518 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1537 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 1); in ext4_ind_remove_space()
1545 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 2); in ext4_ind_remove_space()
1553 ext4_free_branches(handle, inode, NULL, &nr, &nr+1, 3); in ext4_ind_remove_space()