Lines Matching refs:handle
370 static struct buffer_head *bclean(handle_t *handle, struct super_block *sb, in bclean() argument
380 if ((err = ext4_journal_get_write_access(handle, bh))) { in bclean()
396 static int extend_or_restart_transaction(handle_t *handle, int thresh) in extend_or_restart_transaction() argument
400 if (ext4_handle_has_enough_credits(handle, thresh)) in extend_or_restart_transaction()
403 err = ext4_journal_extend(handle, EXT4_MAX_TRANS_DATA); in extend_or_restart_transaction()
407 err = ext4_journal_restart(handle, EXT4_MAX_TRANS_DATA); in extend_or_restart_transaction()
424 static int set_flexbg_block_bitmap(struct super_block *sb, handle_t *handle, in set_flexbg_block_bitmap() argument
454 err = extend_or_restart_transaction(handle, 1); in set_flexbg_block_bitmap()
463 err = ext4_journal_get_write_access(handle, bh); in set_flexbg_block_bitmap()
472 err = ext4_handle_dirty_metadata(handle, NULL, bh); in set_flexbg_block_bitmap()
505 handle_t *handle; in setup_new_flex_group_blocks() local
518 handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, EXT4_MAX_TRANS_DATA); in setup_new_flex_group_blocks()
519 if (IS_ERR(handle)) in setup_new_flex_group_blocks()
520 return PTR_ERR(handle); in setup_new_flex_group_blocks()
547 err = extend_or_restart_transaction(handle, 1); in setup_new_flex_group_blocks()
558 err = ext4_journal_get_write_access(handle, gdb); in setup_new_flex_group_blocks()
567 err = ext4_handle_dirty_metadata(handle, NULL, gdb); in setup_new_flex_group_blocks()
605 err = extend_or_restart_transaction(handle, 1); in setup_new_flex_group_blocks()
609 bh = bclean(handle, sb, block); in setup_new_flex_group_blocks()
623 err = ext4_handle_dirty_metadata(handle, NULL, bh); in setup_new_flex_group_blocks()
634 err = extend_or_restart_transaction(handle, 1); in setup_new_flex_group_blocks()
638 bh = bclean(handle, sb, block); in setup_new_flex_group_blocks()
646 err = ext4_handle_dirty_metadata(handle, NULL, bh); in setup_new_flex_group_blocks()
663 err = set_flexbg_block_bitmap(sb, handle, in setup_new_flex_group_blocks()
677 err = set_flexbg_block_bitmap(sb, handle, in setup_new_flex_group_blocks()
689 err2 = ext4_journal_stop(handle); in setup_new_flex_group_blocks()
779 static int add_new_gdb(handle_t *handle, struct inode *inode, in add_new_gdb() argument
826 err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh); in add_new_gdb()
831 err = ext4_journal_get_write_access(handle, gdb_bh); in add_new_gdb()
836 err = ext4_journal_get_write_access(handle, dind); in add_new_gdb()
841 err = ext4_reserve_inode_write(handle, inode, &iloc); in add_new_gdb()
865 err = ext4_handle_dirty_metadata(handle, NULL, dind); in add_new_gdb()
872 ext4_mark_iloc_dirty(handle, inode, &iloc); in add_new_gdb()
874 err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh); in add_new_gdb()
891 err = ext4_handle_dirty_super(handle, sb); in add_new_gdb()
909 handle_t *handle, ext4_group_t group) { in add_new_gdb_meta_bg() argument
938 err = ext4_journal_get_write_access(handle, gdb_bh); in add_new_gdb_meta_bg()
964 static int reserve_backup_gdb(handle_t *handle, struct inode *inode, in reserve_backup_gdb() argument
1024 if ((err = ext4_journal_get_write_access(handle, primary[i]))) in reserve_backup_gdb()
1028 if ((err = ext4_reserve_inode_write(handle, inode, &iloc))) in reserve_backup_gdb()
1043 err2 = ext4_handle_dirty_metadata(handle, NULL, primary[i]); in reserve_backup_gdb()
1049 ext4_mark_iloc_dirty(handle, inode, &iloc); in reserve_backup_gdb()
1089 handle_t *handle; in update_backups() local
1092 handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, EXT4_MAX_TRANS_DATA); in update_backups()
1093 if (IS_ERR(handle)) { in update_backups()
1095 err = PTR_ERR(handle); in update_backups()
1112 if (ext4_handle_valid(handle) && in update_backups()
1113 handle->h_buffer_credits == 0 && in update_backups()
1114 ext4_journal_extend(handle, EXT4_MAX_TRANS_DATA) && in update_backups()
1115 (err = ext4_journal_restart(handle, EXT4_MAX_TRANS_DATA))) in update_backups()
1133 if ((err = ext4_journal_get_write_access(handle, bh))) { in update_backups()
1143 err = ext4_handle_dirty_metadata(handle, NULL, bh); in update_backups()
1155 if ((err2 = ext4_journal_stop(handle)) && !err) in update_backups()
1188 static int ext4_add_new_descs(handle_t *handle, struct super_block *sb, in ext4_add_new_descs() argument
1215 err = ext4_journal_get_write_access(handle, gdb_bh); in ext4_add_new_descs()
1218 err = reserve_backup_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1220 err = add_new_gdb_meta_bg(sb, handle, group); in ext4_add_new_descs()
1222 err = add_new_gdb(handle, resize_inode, group); in ext4_add_new_descs()
1274 static int ext4_setup_new_descs(handle_t *handle, struct super_block *sb, in ext4_setup_new_descs() argument
1319 err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh); in ext4_setup_new_descs()
1454 handle_t *handle; in ext4_flex_group_add() local
1479 handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credit); in ext4_flex_group_add()
1480 if (IS_ERR(handle)) { in ext4_flex_group_add()
1481 err = PTR_ERR(handle); in ext4_flex_group_add()
1486 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_flex_group_add()
1492 err = ext4_add_new_descs(handle, sb, group, in ext4_flex_group_add()
1497 err = ext4_setup_new_descs(handle, sb, flex_gd); in ext4_flex_group_add()
1503 err = ext4_handle_dirty_super(handle, sb); in ext4_flex_group_add()
1506 err2 = ext4_journal_stop(handle); in ext4_flex_group_add()
1684 handle_t *handle; in ext4_group_extend_no_check() local
1690 handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, 3); in ext4_group_extend_no_check()
1691 if (IS_ERR(handle)) { in ext4_group_extend_no_check()
1692 err = PTR_ERR(handle); in ext4_group_extend_no_check()
1698 err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh); in ext4_group_extend_no_check()
1709 err = ext4_group_add_blocks(handle, sb, o_blocks_count, add); in ext4_group_extend_no_check()
1712 ext4_handle_dirty_super(handle, sb); in ext4_group_extend_no_check()
1716 err2 = ext4_journal_stop(handle); in ext4_group_extend_no_check()
1819 handle_t *handle; in ext4_convert_meta_bg() local
1852 handle = ext4_journal_start_sb(sb, EXT4_HT_RESIZE, credits); in ext4_convert_meta_bg()
1853 if (IS_ERR(handle)) in ext4_convert_meta_bg()
1854 return PTR_ERR(handle); in ext4_convert_meta_bg()
1857 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_convert_meta_bg()
1866 err = ext4_handle_dirty_super(handle, sb); in ext4_convert_meta_bg()
1874 ext4_free_blocks(handle, inode, NULL, nr, 1, in ext4_convert_meta_bg()
1880 err = ext4_mark_inode_dirty(handle, inode); in ext4_convert_meta_bg()
1886 ret = ext4_journal_stop(handle); in ext4_convert_meta_bg()