Lines Matching refs:handle
142 static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh);
170 handle_t *handle; in ext4_evict_inode() local
255 handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE, in ext4_evict_inode()
257 if (IS_ERR(handle)) { in ext4_evict_inode()
258 ext4_std_error(inode->i_sb, PTR_ERR(handle)); in ext4_evict_inode()
271 ext4_handle_sync(handle); in ext4_evict_inode()
283 err = ext4_mark_inode_dirty(handle, inode); in ext4_evict_inode()
300 err = ext4_xattr_delete_inode(handle, inode, &ea_inode_array, in ext4_evict_inode()
305 ext4_journal_stop(handle); in ext4_evict_inode()
321 ext4_orphan_del(handle, inode); in ext4_evict_inode()
331 if (ext4_mark_inode_dirty(handle, inode)) in ext4_evict_inode()
335 ext4_free_inode(handle, inode); in ext4_evict_inode()
336 ext4_journal_stop(handle); in ext4_evict_inode()
446 static void ext4_map_blocks_es_recheck(handle_t *handle, in ext4_map_blocks_es_recheck() argument
464 retval = ext4_ext_map_blocks(handle, inode, map, 0); in ext4_map_blocks_es_recheck()
466 retval = ext4_ind_map_blocks(handle, inode, map, 0); in ext4_map_blocks_es_recheck()
510 int ext4_map_blocks(handle_t *handle, struct inode *inode, in ext4_map_blocks() argument
559 ext4_map_blocks_es_recheck(handle, inode, map, in ext4_map_blocks()
571 retval = ext4_ext_map_blocks(handle, inode, map, 0); in ext4_map_blocks()
573 retval = ext4_ind_map_blocks(handle, inode, map, 0); in ext4_map_blocks()
644 retval = ext4_ext_map_blocks(handle, inode, map, flags); in ext4_map_blocks()
646 retval = ext4_ind_map_blocks(handle, inode, map, flags); in ext4_map_blocks()
729 ret = ext4_jbd2_inode_add_wait(handle, inode, in ext4_map_blocks()
732 ret = ext4_jbd2_inode_add_write(handle, inode, in ext4_map_blocks()
740 ext4_fc_track_range(handle, inode, map->m_lblk, in ext4_map_blocks()
828 struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode, in ext4_getblk() argument
837 || handle != NULL || create == 0); in ext4_getblk()
841 err = ext4_map_blocks(handle, inode, &map, map_flags); in ext4_getblk()
854 || (handle != NULL)); in ext4_getblk()
865 err = ext4_journal_get_create_access(handle, bh); in ext4_getblk()
876 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_getblk()
887 struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode, in ext4_bread() argument
893 bh = ext4_getblk(handle, inode, block, map_flags); in ext4_bread()
950 int ext4_walk_page_buffers(handle_t *handle, in ext4_walk_page_buffers() argument
955 int (*fn)(handle_t *handle, in ext4_walk_page_buffers() argument
974 err = (*fn)(handle, bh); in ext4_walk_page_buffers()
1005 int do_journal_get_write_access(handle_t *handle, in do_journal_get_write_access() argument
1024 ret = ext4_journal_get_write_access(handle, bh); in do_journal_get_write_access()
1026 ret = ext4_handle_dirty_metadata(handle, NULL, bh); in do_journal_get_write_access()
1132 handle_t *handle; in ext4_write_begin() local
1191 handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, needed_blocks); in ext4_write_begin()
1192 if (IS_ERR(handle)) { in ext4_write_begin()
1194 return PTR_ERR(handle); in ext4_write_begin()
1202 ext4_journal_stop(handle); in ext4_write_begin()
1223 ret = ext4_walk_page_buffers(handle, page_buffers(page), in ext4_write_begin()
1242 ext4_orphan_add(handle, inode); in ext4_write_begin()
1244 ext4_journal_stop(handle); in ext4_write_begin()
1268 static int write_end_fn(handle_t *handle, struct buffer_head *bh) in write_end_fn() argument
1274 ret = ext4_handle_dirty_metadata(handle, NULL, bh); in write_end_fn()
1292 handle_t *handle = ext4_journal_current_handle(); in ext4_write_end() local
1337 ret = ext4_mark_inode_dirty(handle, inode); in ext4_write_end()
1345 ext4_orphan_add(handle, inode); in ext4_write_end()
1347 ret2 = ext4_journal_stop(handle); in ext4_write_end()
1370 static void ext4_journalled_zero_new_buffers(handle_t *handle, in ext4_journalled_zero_new_buffers() argument
1389 write_end_fn(handle, bh); in ext4_journalled_zero_new_buffers()
1404 handle_t *handle = ext4_journal_current_handle(); in ext4_journalled_write_end() local
1419 BUG_ON(!ext4_handle_valid(handle)); in ext4_journalled_write_end()
1433 ext4_journalled_zero_new_buffers(handle, page, from, to); in ext4_journalled_write_end()
1436 ext4_journalled_zero_new_buffers(handle, page, in ext4_journalled_write_end()
1438 ret = ext4_walk_page_buffers(handle, page_buffers(page), from, in ext4_journalled_write_end()
1447 EXT4_I(inode)->i_datasync_tid = handle->h_transaction->t_tid; in ext4_journalled_write_end()
1455 ret2 = ext4_mark_inode_dirty(handle, inode); in ext4_journalled_write_end()
1466 ext4_orphan_add(handle, inode); in ext4_journalled_write_end()
1468 ret2 = ext4_journal_stop(handle); in ext4_journalled_write_end()
1647 static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh) in ext4_bh_delay_or_unwritten() argument
1873 static int bget_one(handle_t *handle, struct buffer_head *bh) in bget_one() argument
1879 static int bput_one(handle_t *handle, struct buffer_head *bh) in bput_one() argument
1891 handle_t *handle = NULL; in __ext4_journalled_writepage() local
1910 ext4_walk_page_buffers(handle, page_bufs, 0, len, in __ext4_journalled_writepage()
1921 handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, in __ext4_journalled_writepage()
1923 if (IS_ERR(handle)) { in __ext4_journalled_writepage()
1924 ret = PTR_ERR(handle); in __ext4_journalled_writepage()
1928 BUG_ON(!ext4_handle_valid(handle)); in __ext4_journalled_writepage()
1934 ext4_journal_stop(handle); in __ext4_journalled_writepage()
1940 ret = ext4_mark_inode_dirty(handle, inode); in __ext4_journalled_writepage()
1942 ret = ext4_walk_page_buffers(handle, page_bufs, 0, len, NULL, in __ext4_journalled_writepage()
1945 err = ext4_walk_page_buffers(handle, page_bufs, 0, len, NULL, in __ext4_journalled_writepage()
1950 err = ext4_jbd2_inode_add_write(handle, inode, page_offset(page), len); in __ext4_journalled_writepage()
1953 EXT4_I(inode)->i_datasync_tid = handle->h_transaction->t_tid; in __ext4_journalled_writepage()
1954 err = ext4_journal_stop(handle); in __ext4_journalled_writepage()
2391 static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd) in mpage_map_one_extent() argument
2423 err = ext4_map_blocks(handle, inode, map, get_blocks_flags); in mpage_map_one_extent()
2427 if (!mpd->io_submit.io_end->handle && in mpage_map_one_extent()
2428 ext4_handle_valid(handle)) { in mpage_map_one_extent()
2429 mpd->io_submit.io_end->handle = handle->h_rsv_handle; in mpage_map_one_extent()
2430 handle->h_rsv_handle = NULL; in mpage_map_one_extent()
2459 static int mpage_map_and_submit_extent(handle_t *handle, in mpage_map_and_submit_extent() argument
2476 err = mpage_map_one_extent(handle, mpd); in mpage_map_and_submit_extent()
2537 err2 = ext4_mark_inode_dirty(handle, inode); in mpage_map_and_submit_extent()
2693 handle_t *handle = NULL; in ext4_writepages() local
2743 handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); in ext4_writepages()
2744 if (IS_ERR(handle)) { in ext4_writepages()
2745 ret = PTR_ERR(handle); in ext4_writepages()
2750 ext4_destroy_inline_data(handle, inode); in ext4_writepages()
2751 ext4_journal_stop(handle); in ext4_writepages()
2827 handle = ext4_journal_start_with_reserve(inode, in ext4_writepages()
2829 if (IS_ERR(handle)) { in ext4_writepages()
2830 ret = PTR_ERR(handle); in ext4_writepages()
2844 ret = mpage_map_and_submit_extent(handle, &mpd, in ext4_writepages()
2856 if (!ext4_handle_valid(handle) || handle->h_sync == 0) { in ext4_writepages()
2857 ext4_journal_stop(handle); in ext4_writepages()
2858 handle = NULL; in ext4_writepages()
2873 if (handle) { in ext4_writepages()
2875 ext4_journal_stop(handle); in ext4_writepages()
2994 handle_t *handle; in ext4_da_write_begin() local
3050 handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, in ext4_da_write_begin()
3052 if (IS_ERR(handle)) { in ext4_da_write_begin()
3054 return PTR_ERR(handle); in ext4_da_write_begin()
3062 ext4_journal_stop(handle); in ext4_da_write_begin()
3076 ext4_journal_stop(handle); in ext4_da_write_begin()
3127 handle_t *handle = ext4_journal_current_handle(); in ext4_da_write_end() local
3173 ret2 = ext4_journal_stop(handle); in ext4_da_write_end()
3448 handle_t *handle; in ext4_iomap_alloc() local
3467 handle = ext4_journal_start(inode, EXT4_HT_MAP_BLOCKS, dio_credits); in ext4_iomap_alloc()
3468 if (IS_ERR(handle)) in ext4_iomap_alloc()
3469 return PTR_ERR(handle); in ext4_iomap_alloc()
3489 ret = ext4_map_blocks(handle, inode, map, m_flags); in ext4_iomap_alloc()
3499 ext4_journal_stop(handle); in ext4_iomap_alloc()
3801 static int __ext4_block_zero_page_range(handle_t *handle, in __ext4_block_zero_page_range() argument
3868 err = ext4_journal_get_write_access(handle, bh); in __ext4_block_zero_page_range()
3876 err = ext4_handle_dirty_metadata(handle, inode, bh); in __ext4_block_zero_page_range()
3881 err = ext4_jbd2_inode_add_write(handle, inode, from, in __ext4_block_zero_page_range()
3898 static int ext4_block_zero_page_range(handle_t *handle, in ext4_block_zero_page_range() argument
3917 return __ext4_block_zero_page_range(handle, mapping, from, length); in ext4_block_zero_page_range()
3926 static int ext4_block_truncate_page(handle_t *handle, in ext4_block_truncate_page() argument
3941 return ext4_block_zero_page_range(handle, mapping, from, length); in ext4_block_truncate_page()
3944 int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode, in ext4_zero_partial_blocks() argument
3963 err = ext4_block_zero_page_range(handle, mapping, in ext4_zero_partial_blocks()
3969 err = ext4_block_zero_page_range(handle, mapping, in ext4_zero_partial_blocks()
3976 err = ext4_block_zero_page_range(handle, mapping, in ext4_zero_partial_blocks()
4002 handle_t *handle; in ext4_update_disksize_before_punch() local
4014 handle = ext4_journal_start(inode, EXT4_HT_MISC, 1); in ext4_update_disksize_before_punch()
4015 if (IS_ERR(handle)) in ext4_update_disksize_before_punch()
4016 return PTR_ERR(handle); in ext4_update_disksize_before_punch()
4018 ret = ext4_mark_inode_dirty(handle, inode); in ext4_update_disksize_before_punch()
4019 ext4_journal_stop(handle); in ext4_update_disksize_before_punch()
4073 handle_t *handle; in ext4_punch_hole() local
4159 handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE, credits); in ext4_punch_hole()
4160 if (IS_ERR(handle)) { in ext4_punch_hole()
4161 ret = PTR_ERR(handle); in ext4_punch_hole()
4166 ret = ext4_zero_partial_blocks(handle, inode, offset, in ext4_punch_hole()
4192 ret = ext4_ind_remove_space(handle, inode, first_block, in ext4_punch_hole()
4197 ext4_fc_track_range(handle, inode, first_block, stop_block); in ext4_punch_hole()
4199 ext4_handle_sync(handle); in ext4_punch_hole()
4202 ret2 = ext4_mark_inode_dirty(handle, inode); in ext4_punch_hole()
4206 ext4_update_inode_fsync_trans(handle, inode, 1); in ext4_punch_hole()
4208 ext4_journal_stop(handle); in ext4_punch_hole()
4274 handle_t *handle; in ext4_truncate() local
4312 handle = ext4_journal_start(inode, EXT4_HT_TRUNCATE, credits); in ext4_truncate()
4313 if (IS_ERR(handle)) { in ext4_truncate()
4314 err = PTR_ERR(handle); in ext4_truncate()
4319 ext4_block_truncate_page(handle, mapping, inode->i_size); in ext4_truncate()
4330 err = ext4_orphan_add(handle, inode); in ext4_truncate()
4339 err = ext4_ext_truncate(handle, inode); in ext4_truncate()
4341 ext4_ind_truncate(handle, inode); in ext4_truncate()
4348 ext4_handle_sync(handle); in ext4_truncate()
4359 ext4_orphan_del(handle, inode); in ext4_truncate()
4362 err2 = ext4_mark_inode_dirty(handle, inode); in ext4_truncate()
4365 ext4_journal_stop(handle); in ext4_truncate()
5030 static int ext4_inode_blocks_set(handle_t *handle, in ext4_inode_blocks_set() argument
5140 static int ext4_do_update_inode(handle_t *handle, in ext4_do_update_inode() argument
5161 err = ext4_inode_blocks_set(handle, raw_inode, ei); in ext4_do_update_inode()
5260 err = ext4_handle_dirty_metadata(handle, NULL, bh); in ext4_do_update_inode()
5266 err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh); in ext4_do_update_inode()
5270 ext4_handle_sync(handle); in ext4_do_update_inode()
5271 err = ext4_handle_dirty_super(handle, sb); in ext4_do_update_inode()
5273 ext4_update_inode_fsync_trans(handle, inode, need_datasync); in ext4_do_update_inode()
5472 handle_t *handle; in ext4_setattr() local
5476 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, in ext4_setattr()
5479 if (IS_ERR(handle)) { in ext4_setattr()
5480 error = PTR_ERR(handle); in ext4_setattr()
5492 ext4_journal_stop(handle); in ext4_setattr()
5501 error = ext4_mark_inode_dirty(handle, inode); in ext4_setattr()
5502 ext4_journal_stop(handle); in ext4_setattr()
5509 handle_t *handle; in ext4_setattr() local
5551 handle = ext4_journal_start(inode, EXT4_HT_INODE, 3); in ext4_setattr()
5552 if (IS_ERR(handle)) { in ext4_setattr()
5553 error = PTR_ERR(handle); in ext4_setattr()
5556 if (ext4_handle_valid(handle) && shrink) { in ext4_setattr()
5557 error = ext4_orphan_add(handle, inode); in ext4_setattr()
5570 ext4_fc_track_range(handle, inode, in ext4_setattr()
5576 handle, inode, in ext4_setattr()
5585 rc = ext4_mark_inode_dirty(handle, inode); in ext4_setattr()
5598 ext4_journal_stop(handle); in ext4_setattr()
5819 int ext4_mark_iloc_dirty(handle_t *handle, in ext4_mark_iloc_dirty() argument
5828 ext4_fc_track_inode(handle, inode); in ext4_mark_iloc_dirty()
5842 err = ext4_do_update_inode(handle, inode, iloc); in ext4_mark_iloc_dirty()
5853 ext4_reserve_inode_write(handle_t *handle, struct inode *inode, in ext4_reserve_inode_write() argument
5864 err = ext4_journal_get_write_access(handle, iloc->bh); in ext4_reserve_inode_write()
5877 handle_t *handle, int *no_expand) in __ext4_expand_extra_isize() argument
5922 raw_inode, handle); in __ext4_expand_extra_isize()
5940 handle_t *handle) in ext4_try_to_expand_extra_isize() argument
5957 if (ext4_journal_extend(handle, in ext4_try_to_expand_extra_isize()
5965 handle, &no_expand); in ext4_try_to_expand_extra_isize()
5975 handle_t *handle; in ext4_expand_extra_isize() local
5984 handle = ext4_journal_start(inode, EXT4_HT_INODE, in ext4_expand_extra_isize()
5986 if (IS_ERR(handle)) { in ext4_expand_extra_isize()
5987 error = PTR_ERR(handle); in ext4_expand_extra_isize()
5995 error = ext4_journal_get_write_access(handle, iloc->bh); in ext4_expand_extra_isize()
6002 handle, &no_expand); in ext4_expand_extra_isize()
6004 rc = ext4_mark_iloc_dirty(handle, inode, iloc); in ext4_expand_extra_isize()
6010 ext4_journal_stop(handle); in ext4_expand_extra_isize()
6027 int __ext4_mark_inode_dirty(handle_t *handle, struct inode *inode, in __ext4_mark_inode_dirty() argument
6036 err = ext4_reserve_inode_write(handle, inode, &iloc); in __ext4_mark_inode_dirty()
6042 iloc, handle); in __ext4_mark_inode_dirty()
6044 err = ext4_mark_iloc_dirty(handle, inode, &iloc); in __ext4_mark_inode_dirty()
6072 handle_t *handle; in ext4_dirty_inode() local
6076 handle = ext4_journal_start(inode, EXT4_HT_INODE, 2); in ext4_dirty_inode()
6077 if (IS_ERR(handle)) in ext4_dirty_inode()
6080 ext4_mark_inode_dirty(handle, inode); in ext4_dirty_inode()
6082 ext4_journal_stop(handle); in ext4_dirty_inode()
6090 handle_t *handle; in ext4_change_inode_journal_flag() local
6162 handle = ext4_journal_start(inode, EXT4_HT_INODE, 1); in ext4_change_inode_journal_flag()
6163 if (IS_ERR(handle)) in ext4_change_inode_journal_flag()
6164 return PTR_ERR(handle); in ext4_change_inode_journal_flag()
6168 err = ext4_mark_inode_dirty(handle, inode); in ext4_change_inode_journal_flag()
6169 ext4_handle_sync(handle); in ext4_change_inode_journal_flag()
6170 ext4_journal_stop(handle); in ext4_change_inode_journal_flag()
6176 static int ext4_bh_unmapped(handle_t *handle, struct buffer_head *bh) in ext4_bh_unmapped() argument
6192 handle_t *handle; in ext4_page_mkwrite() local
6265 handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, in ext4_page_mkwrite()
6267 if (IS_ERR(handle)) { in ext4_page_mkwrite()
6295 if (ext4_walk_page_buffers(handle, page_buffers(page), in ext4_page_mkwrite()
6298 if (ext4_walk_page_buffers(handle, page_buffers(page), in ext4_page_mkwrite()
6301 if (ext4_jbd2_inode_add_write(handle, inode, in ext4_page_mkwrite()
6309 ext4_journal_stop(handle); in ext4_page_mkwrite()
6320 ext4_journal_stop(handle); in ext4_page_mkwrite()