• Home
  • Raw
  • Download

Lines Matching refs:handle

50 static struct buffer_head *ext4_append(handle_t *handle,  in ext4_append()  argument
64 bh = ext4_bread(handle, inode, *block, EXT4_GET_BLOCKS_CREATE); in ext4_append()
70 err = ext4_journal_get_write_access(handle, bh); in ext4_append()
276 static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname,
382 int ext4_handle_dirty_dirent_node(handle_t *handle, in ext4_handle_dirty_dirent_node() argument
387 return ext4_handle_dirty_metadata(handle, inode, bh); in ext4_handle_dirty_dirent_node()
492 static inline int ext4_handle_dirty_dx_node(handle_t *handle, in ext4_handle_dirty_dx_node() argument
497 return ext4_handle_dirty_metadata(handle, inode, bh); in ext4_handle_dirty_dx_node()
1688 static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, in do_split() argument
1708 bh2 = ext4_append(handle, dir, &newblock); in do_split()
1716 err = ext4_journal_get_write_access(handle, *bh); in do_split()
1721 err = ext4_journal_get_write_access(handle, frame->bh); in do_split()
1790 err = ext4_handle_dirty_dirent_node(handle, dir, bh2); in do_split()
1793 err = ext4_handle_dirty_dx_node(handle, dir, frame->bh); in do_split()
1876 static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, in add_dirent_to_buf() argument
1895 err = ext4_journal_get_write_access(handle, bh); in add_dirent_to_buf()
1921 ext4_mark_inode_dirty(handle, dir); in add_dirent_to_buf()
1923 err = ext4_handle_dirty_dirent_node(handle, dir, bh); in add_dirent_to_buf()
1933 static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname, in make_indexed_dir() argument
1958 retval = ext4_journal_get_write_access(handle, bh); in make_indexed_dir()
1978 bh2 = ext4_append(handle, dir, &block); in make_indexed_dir()
2025 retval = ext4_handle_dirty_dx_node(handle, dir, frame->bh); in make_indexed_dir()
2028 retval = ext4_handle_dirty_dirent_node(handle, dir, bh2); in make_indexed_dir()
2032 de = do_split(handle,dir, &bh2, frame, &fname->hinfo); in make_indexed_dir()
2038 retval = add_dirent_to_buf(handle, fname, dir, inode, de, bh2); in make_indexed_dir()
2046 ext4_mark_inode_dirty(handle, dir); in make_indexed_dir()
2062 static int ext4_add_entry(handle_t *handle, struct dentry *dentry, in ext4_add_entry() argument
2090 retval = ext4_try_add_inline_entry(handle, &fname, in ext4_add_entry()
2101 retval = ext4_dx_add_entry(handle, &fname, dentry, inode); in ext4_add_entry()
2113 ext4_mark_inode_dirty(handle, dir); in ext4_add_entry()
2123 retval = add_dirent_to_buf(handle, &fname, dir, inode, in ext4_add_entry()
2130 retval = make_indexed_dir(handle, &fname, dentry, in ext4_add_entry()
2137 bh = ext4_append(handle, dir, &block); in ext4_add_entry()
2152 retval = add_dirent_to_buf(handle, &fname, dir, inode, de, bh); in ext4_add_entry()
2164 static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname, in ext4_dx_add_entry() argument
2188 err = ext4_journal_get_write_access(handle, bh); in ext4_dx_add_entry()
2192 err = add_dirent_to_buf(handle, fname, dir, inode, NULL, bh); in ext4_dx_add_entry()
2214 bh2 = ext4_append(handle, dir, &newblock); in ext4_dx_add_entry()
2225 err = ext4_journal_get_write_access(handle, frame->bh); in ext4_dx_add_entry()
2235 err = ext4_journal_get_write_access(handle, in ext4_dx_add_entry()
2256 err = ext4_handle_dirty_dx_node(handle, dir, bh2); in ext4_dx_add_entry()
2277 err = ext4_journal_get_write_access(handle, in ext4_dx_add_entry()
2282 err = ext4_handle_dirty_dx_node(handle, dir, frames[0].bh); in ext4_dx_add_entry()
2288 de = do_split(handle, dir, &bh, frame, &fname->hinfo); in ext4_dx_add_entry()
2293 err = add_dirent_to_buf(handle, fname, dir, inode, de, bh); in ext4_dx_add_entry()
2308 int ext4_generic_delete_entry(handle_t *handle, in ext4_generic_delete_entry() argument
2347 static int ext4_delete_entry(handle_t *handle, in ext4_delete_entry() argument
2356 err = ext4_delete_inline_entry(handle, dir, de_del, bh, in ext4_delete_entry()
2366 err = ext4_journal_get_write_access(handle, bh); in ext4_delete_entry()
2370 err = ext4_generic_delete_entry(handle, dir, de_del, in ext4_delete_entry()
2377 err = ext4_handle_dirty_dirent_node(handle, dir, bh); in ext4_delete_entry()
2392 static void ext4_inc_count(handle_t *handle, struct inode *inode) in ext4_inc_count() argument
2408 static void ext4_dec_count(handle_t *handle, struct inode *inode) in ext4_dec_count() argument
2415 static int ext4_add_nondir(handle_t *handle, in ext4_add_nondir() argument
2418 int err = ext4_add_entry(handle, dentry, inode); in ext4_add_nondir()
2420 ext4_mark_inode_dirty(handle, inode); in ext4_add_nondir()
2441 handle_t *handle; in ext4_create() local
2454 handle = ext4_journal_current_handle(); in ext4_create()
2460 err = ext4_add_nondir(handle, dentry, inode); in ext4_create()
2462 ext4_handle_sync(handle); in ext4_create()
2464 if (handle) in ext4_create()
2465 ext4_journal_stop(handle); in ext4_create()
2474 handle_t *handle; in ext4_mknod() local
2487 handle = ext4_journal_current_handle(); in ext4_mknod()
2492 err = ext4_add_nondir(handle, dentry, inode); in ext4_mknod()
2494 ext4_handle_sync(handle); in ext4_mknod()
2496 if (handle) in ext4_mknod()
2497 ext4_journal_stop(handle); in ext4_mknod()
2505 handle_t *handle; in ext4_tmpfile() local
2519 handle = ext4_journal_current_handle(); in ext4_tmpfile()
2526 err = ext4_orphan_add(handle, inode); in ext4_tmpfile()
2532 if (handle) in ext4_tmpfile()
2533 ext4_journal_stop(handle); in ext4_tmpfile()
2538 ext4_journal_stop(handle); in ext4_tmpfile()
2571 static int ext4_init_new_dir(handle_t *handle, struct inode *dir, in ext4_init_new_dir() argument
2586 err = ext4_try_create_inline_dir(handle, dir, inode); in ext4_init_new_dir()
2594 dir_block = ext4_append(handle, inode, &block); in ext4_init_new_dir()
2606 err = ext4_handle_dirty_dirent_node(handle, inode, dir_block); in ext4_init_new_dir()
2617 handle_t *handle; in ext4_mkdir() local
2634 handle = ext4_journal_current_handle(); in ext4_mkdir()
2641 err = ext4_init_new_dir(handle, dir, inode); in ext4_mkdir()
2644 err = ext4_mark_inode_dirty(handle, inode); in ext4_mkdir()
2646 err = ext4_add_entry(handle, dentry, inode); in ext4_mkdir()
2651 ext4_mark_inode_dirty(handle, inode); in ext4_mkdir()
2655 ext4_inc_count(handle, dir); in ext4_mkdir()
2657 err = ext4_mark_inode_dirty(handle, dir); in ext4_mkdir()
2662 ext4_handle_sync(handle); in ext4_mkdir()
2665 if (handle) in ext4_mkdir()
2666 ext4_journal_stop(handle); in ext4_mkdir()
2753 int ext4_orphan_add(handle_t *handle, struct inode *inode) in ext4_orphan_add() argument
2783 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_orphan_add()
2787 err = ext4_reserve_inode_write(handle, inode, &iloc); in ext4_orphan_add()
2807 err = ext4_handle_dirty_super(handle, sb); in ext4_orphan_add()
2808 rc = ext4_mark_iloc_dirty(handle, inode, &iloc); in ext4_orphan_add()
2836 int ext4_orphan_del(handle_t *handle, struct inode *inode) in ext4_orphan_del() argument
2854 if (handle) { in ext4_orphan_del()
2856 err = ext4_reserve_inode_write(handle, inode, &iloc); in ext4_orphan_del()
2869 if (!handle || err) { in ext4_orphan_del()
2878 err = ext4_journal_get_write_access(handle, sbi->s_sbh); in ext4_orphan_del()
2885 err = ext4_handle_dirty_super(handle, inode->i_sb); in ext4_orphan_del()
2893 err = ext4_reserve_inode_write(handle, i_prev, &iloc2); in ext4_orphan_del()
2899 err = ext4_mark_iloc_dirty(handle, i_prev, &iloc2); in ext4_orphan_del()
2905 err = ext4_mark_iloc_dirty(handle, inode, &iloc); in ext4_orphan_del()
2921 handle_t *handle = NULL; in ext4_rmdir() local
2949 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_rmdir()
2951 if (IS_ERR(handle)) { in ext4_rmdir()
2952 retval = PTR_ERR(handle); in ext4_rmdir()
2953 handle = NULL; in ext4_rmdir()
2958 ext4_handle_sync(handle); in ext4_rmdir()
2960 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_rmdir()
2974 ext4_orphan_add(handle, inode); in ext4_rmdir()
2976 ext4_mark_inode_dirty(handle, inode); in ext4_rmdir()
2977 ext4_dec_count(handle, dir); in ext4_rmdir()
2979 ext4_mark_inode_dirty(handle, dir); in ext4_rmdir()
2983 if (handle) in ext4_rmdir()
2984 ext4_journal_stop(handle); in ext4_rmdir()
2994 handle_t *handle = NULL; in ext4_unlink() local
3019 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_unlink()
3021 if (IS_ERR(handle)) { in ext4_unlink()
3022 retval = PTR_ERR(handle); in ext4_unlink()
3023 handle = NULL; in ext4_unlink()
3028 ext4_handle_sync(handle); in ext4_unlink()
3030 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_unlink()
3035 ext4_mark_inode_dirty(handle, dir); in ext4_unlink()
3042 ext4_orphan_add(handle, inode); in ext4_unlink()
3044 ext4_mark_inode_dirty(handle, inode); in ext4_unlink()
3048 if (handle) in ext4_unlink()
3049 ext4_journal_stop(handle); in ext4_unlink()
3057 handle_t *handle; in ext4_symlink() local
3115 handle = ext4_journal_current_handle(); in ext4_symlink()
3117 if (handle) in ext4_symlink()
3118 ext4_journal_stop(handle); in ext4_symlink()
3155 err = ext4_orphan_add(handle, inode); in ext4_symlink()
3156 ext4_journal_stop(handle); in ext4_symlink()
3157 handle = NULL; in ext4_symlink()
3167 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_symlink()
3170 if (IS_ERR(handle)) { in ext4_symlink()
3171 err = PTR_ERR(handle); in ext4_symlink()
3172 handle = NULL; in ext4_symlink()
3176 err = ext4_orphan_del(handle, inode); in ext4_symlink()
3191 err = ext4_add_nondir(handle, dentry, inode); in ext4_symlink()
3193 ext4_handle_sync(handle); in ext4_symlink()
3195 if (handle) in ext4_symlink()
3196 ext4_journal_stop(handle); in ext4_symlink()
3200 if (handle) in ext4_symlink()
3201 ext4_journal_stop(handle); in ext4_symlink()
3213 handle_t *handle; in ext4_link() local
3227 handle = ext4_journal_start(dir, EXT4_HT_DIR, in ext4_link()
3230 if (IS_ERR(handle)) in ext4_link()
3231 return PTR_ERR(handle); in ext4_link()
3234 ext4_handle_sync(handle); in ext4_link()
3237 ext4_inc_count(handle, inode); in ext4_link()
3240 err = ext4_add_entry(handle, dentry, inode); in ext4_link()
3242 ext4_mark_inode_dirty(handle, inode); in ext4_link()
3247 ext4_orphan_del(handle, inode); in ext4_link()
3253 ext4_journal_stop(handle); in ext4_link()
3265 static struct buffer_head *ext4_get_first_dir_block(handle_t *handle, in ext4_get_first_dir_block() argument
3307 static int ext4_rename_dir_prepare(handle_t *handle, struct ext4_renament *ent) in ext4_rename_dir_prepare() argument
3311 ent->dir_bh = ext4_get_first_dir_block(handle, ent->inode, in ext4_rename_dir_prepare()
3319 return ext4_journal_get_write_access(handle, ent->dir_bh); in ext4_rename_dir_prepare()
3322 static int ext4_rename_dir_finish(handle_t *handle, struct ext4_renament *ent, in ext4_rename_dir_finish() argument
3331 retval = ext4_handle_dirty_dx_node(handle, in ext4_rename_dir_finish()
3335 retval = ext4_handle_dirty_dirent_node(handle, in ext4_rename_dir_finish()
3340 retval = ext4_mark_inode_dirty(handle, ent->inode); in ext4_rename_dir_finish()
3349 static int ext4_setent(handle_t *handle, struct ext4_renament *ent, in ext4_setent() argument
3355 retval = ext4_journal_get_write_access(handle, ent->bh); in ext4_setent()
3364 ext4_mark_inode_dirty(handle, ent->dir); in ext4_setent()
3367 retval = ext4_handle_dirty_dirent_node(handle, in ext4_setent()
3378 static void ext4_resetent(handle_t *handle, struct ext4_renament *ent, in ext4_resetent() argument
3399 ext4_setent(handle, &old, ino, file_type); in ext4_resetent()
3403 static int ext4_find_delete_entry(handle_t *handle, struct inode *dir, in ext4_find_delete_entry() argument
3414 retval = ext4_delete_entry(handle, dir, de, bh); in ext4_find_delete_entry()
3420 static void ext4_rename_delete(handle_t *handle, struct ext4_renament *ent, in ext4_rename_delete() argument
3435 retval = ext4_find_delete_entry(handle, ent->dir, in ext4_rename_delete()
3438 retval = ext4_delete_entry(handle, ent->dir, ent->de, ent->bh); in ext4_rename_delete()
3440 retval = ext4_find_delete_entry(handle, ent->dir, in ext4_rename_delete()
3452 static void ext4_update_dir_count(handle_t *handle, struct ext4_renament *ent) in ext4_update_dir_count() argument
3456 ext4_dec_count(handle, ent->dir); in ext4_update_dir_count()
3458 ext4_inc_count(handle, ent->dir); in ext4_update_dir_count()
3459 ext4_mark_inode_dirty(handle, ent->dir); in ext4_update_dir_count()
3467 handle_t *handle; in ext4_whiteout_for_rename() local
3481 handle = ext4_journal_current_handle(); in ext4_whiteout_for_rename()
3483 if (handle) in ext4_whiteout_for_rename()
3484 ext4_journal_stop(handle); in ext4_whiteout_for_rename()
3489 *h = handle; in ext4_whiteout_for_rename()
3508 handle_t *handle = NULL; in ext4_rename() local
3586 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, credits); in ext4_rename()
3587 if (IS_ERR(handle)) { in ext4_rename()
3588 retval = PTR_ERR(handle); in ext4_rename()
3592 whiteout = ext4_whiteout_for_rename(&old, credits, &handle); in ext4_rename()
3601 ext4_handle_sync(handle); in ext4_rename()
3613 retval = ext4_rename_dir_prepare(handle, &old); in ext4_rename()
3632 retval = ext4_setent(handle, &old, whiteout->i_ino, in ext4_rename()
3636 ext4_mark_inode_dirty(handle, whiteout); in ext4_rename()
3639 retval = ext4_add_entry(handle, new.dentry, old.inode); in ext4_rename()
3643 retval = ext4_setent(handle, &new, in ext4_rename()
3657 ext4_mark_inode_dirty(handle, old.inode); in ext4_rename()
3663 ext4_rename_delete(handle, &old, force_reread); in ext4_rename()
3667 ext4_dec_count(handle, new.inode); in ext4_rename()
3673 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); in ext4_rename()
3677 ext4_dec_count(handle, old.dir); in ext4_rename()
3684 ext4_inc_count(handle, new.dir); in ext4_rename()
3686 ext4_mark_inode_dirty(handle, new.dir); in ext4_rename()
3689 ext4_mark_inode_dirty(handle, old.dir); in ext4_rename()
3691 ext4_mark_inode_dirty(handle, new.inode); in ext4_rename()
3693 ext4_orphan_add(handle, new.inode); in ext4_rename()
3700 ext4_resetent(handle, &old, in ext4_rename()
3703 ext4_orphan_add(handle, whiteout); in ext4_rename()
3706 ext4_journal_stop(handle); in ext4_rename()
3709 ext4_journal_stop(handle); in ext4_rename()
3721 handle_t *handle = NULL; in ext4_cross_rename() local
3783 handle = ext4_journal_start(old.dir, EXT4_HT_DIR, in ext4_cross_rename()
3786 if (IS_ERR(handle)) { in ext4_cross_rename()
3787 retval = PTR_ERR(handle); in ext4_cross_rename()
3788 handle = NULL; in ext4_cross_rename()
3793 ext4_handle_sync(handle); in ext4_cross_rename()
3797 retval = ext4_rename_dir_prepare(handle, &old); in ext4_cross_rename()
3803 retval = ext4_rename_dir_prepare(handle, &new); in ext4_cross_rename()
3822 retval = ext4_setent(handle, &new, old.inode->i_ino, old.de->file_type); in ext4_cross_rename()
3826 retval = ext4_setent(handle, &old, new.inode->i_ino, new_file_type); in ext4_cross_rename()
3836 ext4_mark_inode_dirty(handle, old.inode); in ext4_cross_rename()
3837 ext4_mark_inode_dirty(handle, new.inode); in ext4_cross_rename()
3840 retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); in ext4_cross_rename()
3845 retval = ext4_rename_dir_finish(handle, &new, old.dir->i_ino); in ext4_cross_rename()
3849 ext4_update_dir_count(handle, &old); in ext4_cross_rename()
3850 ext4_update_dir_count(handle, &new); in ext4_cross_rename()
3858 if (handle) in ext4_cross_rename()
3859 ext4_journal_stop(handle); in ext4_cross_rename()