Lines Matching refs:handle
53 static struct buffer_head *ext4_append(handle_t *handle, in ext4_append() argument
67 bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE); in ext4_append()
73 err = ext4_journal_get_write_access(handle, bh); in ext4_append()
292 static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
399 int ext4_handle_dirty_dirblock(handle_t *handle, in ext4_handle_dirty_dirblock() argument
404 return ext4_handle_dirty_metadata(handle, inode, bh); in ext4_handle_dirty_dirblock()
509 static inline int ext4_handle_dirty_dx_node(handle_t *handle, in ext4_handle_dirty_dx_node() argument
514 return ext4_handle_dirty_metadata(handle, inode, bh); in ext4_handle_dirty_dx_node()
1810 static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, in do_split() argument
1829 bh2 = ext4_append(handle, dir, &newblock); in do_split()
1837 err = ext4_journal_get_write_access(handle, *bh); in do_split()
1842 err = ext4_journal_get_write_access(handle, frame->bh); in do_split()
1898 err = ext4_handle_dirty_dirblock(handle, dir, bh2); in do_split()
1901 err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); in do_split()
1982 static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, in add_dirent_to_buf() argument
2001 err = ext4_journal_get_write_access(handle, bh); in add_dirent_to_buf()
2024 ext4_mark_inode_dirty(handle, dir); in add_dirent_to_buf()
2026 err = ext4_handle_dirty_dirblock(handle, dir, bh); in add_dirent_to_buf()
2036 static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname, in make_indexed_dir() argument
2059 retval = ext4_journal_get_write_access(handle, bh); in make_indexed_dir()
2079 bh2 = ext4_append(handle, dir, &block); in make_indexed_dir()
2123 retval = ext4_handle_dirty_dx_node(handle, dir, frame->bh); in make_indexed_dir()
2126 retval = ext4_handle_dirty_dirblock(handle, dir, bh2); in make_indexed_dir()
2130 de = do_split(handle,dir, &bh2, frame, &fname->hinfo); in make_indexed_dir()
2136 retval = add_dirent_to_buf(handle, fname, dir, inode, de, bh2); in make_indexed_dir()
2144 ext4_mark_inode_dirty(handle, dir); in make_indexed_dir()
2160 static int ext4_add_entry(handle_t *handle, struct dentry *dentry, in ext4_add_entry() argument
2195 retval = ext4_try_add_inline_entry(handle, &fname, dir, inode); in ext4_add_entry()
2205 retval = ext4_dx_add_entry(handle, &fname, dir, inode); in ext4_add_entry()
2210 ext4_mark_inode_dirty(handle, dir); in ext4_add_entry()
2216 bh = ext4_bread(handle, dir, block, in ext4_add_entry()
2225 retval = add_dirent_to_buf(handle, &fname, dir, inode, in ext4_add_entry()
2232 retval = make_indexed_dir(handle, &fname, dir, in ext4_add_entry()
2239 bh = ext4_append(handle, dir, &block); in ext4_add_entry()
2253 retval = add_dirent_to_buf(handle, &fname, dir, inode, de, bh); in ext4_add_entry()
2265 static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname, in ext4_dx_add_entry() argument
2291 err = ext4_journal_get_write_access(handle, bh); in ext4_dx_add_entry()
2295 err = add_dirent_to_buf(handle, fname, dir, inode, NULL, bh); in ext4_dx_add_entry()
2337 bh2 = ext4_append(handle, dir, &newblock); in ext4_dx_add_entry()
2348 err = ext4_journal_get_write_access(handle, frame->bh); in ext4_dx_add_entry()
2358 err = ext4_journal_get_write_access(handle, in ext4_dx_add_entry()
2379 err = ext4_handle_dirty_dx_node(handle, dir, bh2); in ext4_dx_add_entry()
2383 err = ext4_handle_dirty_dx_node(handle, dir, in ext4_dx_add_entry()
2388 err = ext4_handle_dirty_dx_node(handle, dir, in ext4_dx_add_entry()
2406 err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); in ext4_dx_add_entry()
2409 err = ext4_handle_dirty_dx_node(handle, dir, bh2); in ext4_dx_add_entry()
2415 de = do_split(handle, dir, &bh, frame, &fname->hinfo); in ext4_dx_add_entry()
2420 err = add_dirent_to_buf(handle, fname, dir, inode, de, bh); in ext4_dx_add_entry()
2440 int ext4_generic_delete_entry(handle_t *handle, in ext4_generic_delete_entry() argument
2479 static int ext4_delete_entry(handle_t *handle, in ext4_delete_entry() argument
2488 err = ext4_delete_inline_entry(handle, dir, de_del, bh, in ext4_delete_entry()
2498 err = ext4_journal_get_write_access(handle, bh); in ext4_delete_entry()
2502 err = ext4_generic_delete_entry(handle, dir, de_del, in ext4_delete_entry()
2509 err = ext4_handle_dirty_dirblock(handle, dir, bh); in ext4_delete_entry()
2531 static void ext4_inc_count(handle_t *handle, struct inode *inode) in ext4_inc_count() argument
2543 static void ext4_dec_count(handle_t *handle, struct inode *inode) in ext4_dec_count() argument
2550 static int ext4_add_nondir(handle_t *handle, in ext4_add_nondir() argument
2553 int err = ext4_add_entry(handle, dentry, inode); in ext4_add_nondir()
2555 ext4_mark_inode_dirty(handle, inode); in ext4_add_nondir()
2576 handle_t *handle; in ext4_create() local
2589 handle = ext4_journal_current_handle(); in ext4_create()
2595 err = ext4_add_nondir(handle, dentry, inode); in ext4_create()
2597 ext4_handle_sync(handle); in ext4_create()
2599 if (handle) in ext4_create()
2600 ext4_journal_stop(handle); in ext4_create()
2609 handle_t *handle; in ext4_mknod() local
2622 handle = ext4_journal_current_handle(); in ext4_mknod()
2627 err = ext4_add_nondir(handle, dentry, inode); in ext4_mknod()
2629 ext4_handle_sync(handle); in ext4_mknod()
2631 if (handle) in ext4_mknod()
2632 ext4_journal_stop(handle); in ext4_mknod()
2640 handle_t *handle; in ext4_tmpfile() local
2654 handle = ext4_journal_current_handle(); in ext4_tmpfile()
2661 err = ext4_orphan_add(handle, inode); in ext4_tmpfile()
2667 if (handle) in ext4_tmpfile()
2668 ext4_journal_stop(handle); in ext4_tmpfile()
2673 ext4_journal_stop(handle); in ext4_tmpfile()
2706 static int ext4_init_new_dir(handle_t *handle, struct inode *dir, in ext4_init_new_dir() argument
2720 err = ext4_try_create_inline_dir(handle, dir, inode); in ext4_init_new_dir()
2728 dir_block = ext4_append(handle, inode, &block); in ext4_init_new_dir()
2738 err = ext4_handle_dirty_dirblock(handle, inode, dir_block); in ext4_init_new_dir()
2749 handle_t *handle; in ext4_mkdir() local
2766 handle = ext4_journal_current_handle(); in ext4_mkdir()
2773 err = ext4_init_new_dir(handle, dir, inode); in ext4_mkdir()
2776 err = ext4_mark_inode_dirty(handle, inode); in ext4_mkdir()
2778 err = ext4_add_entry(handle, dentry, inode); in ext4_mkdir()
2783 ext4_mark_inode_dirty(handle, inode); in ext4_mkdir()
2787 ext4_inc_count(handle, dir); in ext4_mkdir()
2789 err = ext4_mark_inode_dirty(handle, dir); in ext4_mkdir()
2794 ext4_handle_sync(handle); in ext4_mkdir()
2797 if (handle) in ext4_mkdir()
2798 ext4_journal_stop(handle); in ext4_mkdir()
2895 int ext4_orphan_add(handle_t *handle, struct inode *inode) in ext4_orphan_add() argument
2925 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_orphan_add()
2929 err = ext4_reserve_inode_write(handle, inode, &iloc); in ext4_orphan_add()
2949 err = ext4_handle_dirty_super(handle, sb); in ext4_orphan_add()
2950 rc = ext4_mark_iloc_dirty(handle, inode, &iloc); in ext4_orphan_add()
2978 int ext4_orphan_del(handle_t *handle, struct inode *inode) in ext4_orphan_del() argument
2996 if (handle) { in ext4_orphan_del()
2998 err = ext4_reserve_inode_write(handle, inode, &iloc); in ext4_orphan_del()
3011 if (!handle || err) { in ext4_orphan_del()
3020 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_orphan_del()
3027 err = ext4_handle_dirty_super(handle, inode->i_sb); in ext4_orphan_del()
3035 err = ext4_reserve_inode_write(handle, i_prev, &iloc2); in ext4_orphan_del()
3041 err = ext4_mark_iloc_dirty(handle, i_prev, &iloc2); in ext4_orphan_del()
3047 err = ext4_mark_iloc_dirty(handle, inode, &iloc); in ext4_orphan_del()
3063 handle_t *handle = NULL; in ext4_rmdir() local
3094 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_rmdir()
3096 if (IS_ERR(handle)) { in ext4_rmdir()
3097 retval = PTR_ERR(handle); in ext4_rmdir()
3098 handle = NULL; in ext4_rmdir()
3103 ext4_handle_sync(handle); in ext4_rmdir()
3105 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_rmdir()
3119 ext4_orphan_add(handle, inode); in ext4_rmdir()
3121 ext4_mark_inode_dirty(handle, inode); in ext4_rmdir()
3122 ext4_dec_count(handle, dir); in ext4_rmdir()
3124 ext4_mark_inode_dirty(handle, dir); in ext4_rmdir()
3139 if (handle) in ext4_rmdir()
3140 ext4_journal_stop(handle); in ext4_rmdir()
3150 handle_t *handle = NULL; in ext4_unlink() local
3178 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_unlink()
3180 if (IS_ERR(handle)) { in ext4_unlink()
3181 retval = PTR_ERR(handle); in ext4_unlink()
3182 handle = NULL; in ext4_unlink()
3187 ext4_handle_sync(handle); in ext4_unlink()
3189 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_unlink()
3194 ext4_mark_inode_dirty(handle, dir); in ext4_unlink()
3201 ext4_orphan_add(handle, inode); in ext4_unlink()
3203 ext4_mark_inode_dirty(handle, inode); in ext4_unlink()
3218 if (handle) in ext4_unlink()
3219 ext4_journal_stop(handle); in ext4_unlink()
3227 handle_t *handle; in ext4_symlink() local
3268 handle = ext4_journal_current_handle(); in ext4_symlink()
3270 if (handle) in ext4_symlink()
3271 ext4_journal_stop(handle); in ext4_symlink()
3298 err = ext4_orphan_add(handle, inode); in ext4_symlink()
3299 ext4_journal_stop(handle); in ext4_symlink()
3300 handle = NULL; in ext4_symlink()
3310 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_symlink()
3313 if (IS_ERR(handle)) { in ext4_symlink()
3314 err = PTR_ERR(handle); in ext4_symlink()
3315 handle = NULL; in ext4_symlink()
3319 err = ext4_orphan_del(handle, inode); in ext4_symlink()
3334 err = ext4_add_nondir(handle, dentry, inode); in ext4_symlink()
3336 ext4_handle_sync(handle); in ext4_symlink()
3338 if (handle) in ext4_symlink()
3339 ext4_journal_stop(handle); in ext4_symlink()
3343 if (handle) in ext4_symlink()
3344 ext4_journal_stop(handle); in ext4_symlink()
3357 handle_t *handle; in ext4_link() local
3378 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_link()
3381 if (IS_ERR(handle)) in ext4_link()
3382 return PTR_ERR(handle); in ext4_link()
3385 ext4_handle_sync(handle); in ext4_link()
3388 ext4_inc_count(handle, inode); in ext4_link()
3391 err = ext4_add_entry(handle, dentry, inode); in ext4_link()
3393 ext4_mark_inode_dirty(handle, inode); in ext4_link()
3398 ext4_orphan_del(handle, inode); in ext4_link()
3404 ext4_journal_stop(handle); in ext4_link()
3416 static struct buffer_head *ext4_get_first_dir_block(handle_t *handle, in ext4_get_first_dir_block() argument
3461 static int ext4_rename_dir_prepare(handle_t *handle, struct ext4_renament *ent) in ext4_rename_dir_prepare() argument
3465 ent->dir_bh = ext4_get_first_dir_block(handle, ent->inode, in ext4_rename_dir_prepare()
3473 return ext4_journal_get_write_access(handle, ent->dir_bh); in ext4_rename_dir_prepare()
3476 static int ext4_rename_dir_finish(handle_t *handle, struct ext4_renament *ent, in ext4_rename_dir_finish() argument
3485 retval = ext4_handle_dirty_dx_node(handle, in ext4_rename_dir_finish()
3489 retval = ext4_handle_dirty_dirblock(handle, ent->inode, in ext4_rename_dir_finish()
3493 retval = ext4_mark_inode_dirty(handle, ent->inode); in ext4_rename_dir_finish()
3502 static int ext4_setent(handle_t *handle, struct ext4_renament *ent, in ext4_setent() argument
3508 retval = ext4_journal_get_write_access(handle, ent->bh); in ext4_setent()
3517 ext4_mark_inode_dirty(handle, ent->dir); in ext4_setent()
3520 retval = ext4_handle_dirty_dirblock(handle, ent->dir, ent->bh); in ext4_setent()
3532 static int ext4_find_delete_entry(handle_t *handle, struct inode *dir, in ext4_find_delete_entry() argument
3543 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_find_delete_entry()
3549 static void ext4_rename_delete(handle_t *handle, struct ext4_renament *ent, in ext4_rename_delete() argument
3564 retval = ext4_find_delete_entry(handle, ent->dir, in ext4_rename_delete()
3567 retval = ext4_delete_entry(handle, ent->dir, ent->de, ent->bh); in ext4_rename_delete()
3569 retval = ext4_find_delete_entry(handle, ent->dir, in ext4_rename_delete()
3581 static void ext4_update_dir_count(handle_t *handle, struct ext4_renament *ent) in ext4_update_dir_count() argument
3585 ext4_dec_count(handle, ent->dir); in ext4_update_dir_count()
3587 ext4_inc_count(handle, ent->dir); in ext4_update_dir_count()
3588 ext4_mark_inode_dirty(handle, ent->dir); in ext4_update_dir_count()
3596 handle_t *handle; in ext4_whiteout_for_rename() local
3610 handle = ext4_journal_current_handle(); in ext4_whiteout_for_rename()
3612 if (handle) in ext4_whiteout_for_rename()
3613 ext4_journal_stop(handle); in ext4_whiteout_for_rename()
3618 *h = handle; in ext4_whiteout_for_rename()
3637 handle_t *handle = NULL; in ext4_rename() local
3712 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); in ext4_rename()
3713 if (IS_ERR(handle)) { in ext4_rename()
3714 retval = PTR_ERR(handle); in ext4_rename()
3715 handle = NULL; in ext4_rename()
3719 whiteout = ext4_whiteout_for_rename(&old, credits, &handle); in ext4_rename()
3728 ext4_handle_sync(handle); in ext4_rename()
3740 retval = ext4_rename_dir_prepare(handle, &old); in ext4_rename()
3760 retval = ext4_setent(handle, &old, whiteout->i_ino, in ext4_rename()
3764 ext4_mark_inode_dirty(handle, whiteout); in ext4_rename()
3767 retval = ext4_add_entry(handle, new.dentry, old.inode); in ext4_rename()
3771 retval = ext4_setent(handle, &new, in ext4_rename()
3785 ext4_mark_inode_dirty(handle, old.inode); in ext4_rename()
3791 ext4_rename_delete(handle, &old, force_reread); in ext4_rename()
3795 ext4_dec_count(handle, new.inode); in ext4_rename()
3801 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); in ext4_rename()
3805 ext4_dec_count(handle, old.dir); in ext4_rename()
3812 ext4_inc_count(handle, new.dir); in ext4_rename()
3814 ext4_mark_inode_dirty(handle, new.dir); in ext4_rename()
3817 ext4_mark_inode_dirty(handle, old.dir); in ext4_rename()
3819 ext4_mark_inode_dirty(handle, new.inode); in ext4_rename()
3821 ext4_orphan_add(handle, new.inode); in ext4_rename()
3835 if (handle) in ext4_rename()
3836 ext4_journal_stop(handle); in ext4_rename()
3843 handle_t *handle = NULL; in ext4_cross_rename() local
3899 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, in ext4_cross_rename()
3902 if (IS_ERR(handle)) { in ext4_cross_rename()
3903 retval = PTR_ERR(handle); in ext4_cross_rename()
3904 handle = NULL; in ext4_cross_rename()
3909 ext4_handle_sync(handle); in ext4_cross_rename()
3913 retval = ext4_rename_dir_prepare(handle, &old); in ext4_cross_rename()
3919 retval = ext4_rename_dir_prepare(handle, &new); in ext4_cross_rename()
3938 retval = ext4_setent(handle, &new, old.inode->i_ino, old.de->file_type); in ext4_cross_rename()
3942 retval = ext4_setent(handle, &old, new.inode->i_ino, new_file_type); in ext4_cross_rename()
3953 ext4_mark_inode_dirty(handle, old.inode); in ext4_cross_rename()
3954 ext4_mark_inode_dirty(handle, new.inode); in ext4_cross_rename()
3957 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); in ext4_cross_rename()
3962 retval = ext4_rename_dir_finish(handle, &new, old.dir->i_ino); in ext4_cross_rename()
3966 ext4_update_dir_count(handle, &old); in ext4_cross_rename()
3967 ext4_update_dir_count(handle, &new); in ext4_cross_rename()
3975 if (handle) in ext4_cross_rename()
3976 ext4_journal_stop(handle); in ext4_cross_rename()