Lines Matching refs:orig_inode
71 ext4_double_up_write_data_sem(struct inode *orig_inode, in ext4_double_up_write_data_sem() argument
74 up_write(&EXT4_I(orig_inode)->i_data_sem); in ext4_double_up_write_data_sem()
252 struct inode *orig_inode = file_inode(o_filp); in move_extent_per_page() local
256 unsigned long blocksize = orig_inode->i_sb->s_blocksize; in move_extent_per_page()
260 int from = data_offset_in_page << orig_inode->i_blkbits; in move_extent_per_page()
261 int blocks_per_page = PAGE_SIZE >> orig_inode->i_blkbits; in move_extent_per_page()
262 struct super_block *sb = orig_inode->i_sb; in move_extent_per_page()
271 jblocks = ext4_writepage_trans_blocks(orig_inode) * 2; in move_extent_per_page()
272 handle = ext4_journal_start(orig_inode, EXT4_HT_MOVE_EXTENTS, jblocks); in move_extent_per_page()
286 ((orig_inode->i_size - 1) >> orig_inode->i_blkbits)) { in move_extent_per_page()
288 tmp_data_size = orig_inode->i_size & (blocksize - 1); in move_extent_per_page()
297 ((block_len_in_page - 1) << orig_inode->i_blkbits); in move_extent_per_page()
299 data_size = block_len_in_page << orig_inode->i_blkbits; in move_extent_per_page()
303 *err = mext_page_double_lock(orig_inode, donor_inode, orig_page_offset, in move_extent_per_page()
315 ext4_double_down_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
318 unwritten = mext_check_coverage(orig_inode, orig_blk_offset, in move_extent_per_page()
329 ext4_double_up_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
339 replaced_count = ext4_swap_extents(handle, orig_inode, in move_extent_per_page()
344 ext4_double_up_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
359 ext4_double_down_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
360 replaced_count = ext4_swap_extents(handle, orig_inode, donor_inode, in move_extent_per_page()
363 ext4_double_up_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
368 block_len_in_page << orig_inode->i_blkbits; in move_extent_per_page()
375 create_empty_buffers(pagep[0], 1 << orig_inode->i_blkbits, 0); in move_extent_per_page()
380 *err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0); in move_extent_per_page()
393 *err = ext4_jbd2_inode_add_write(handle, orig_inode, in move_extent_per_page()
419 ext4_double_down_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
420 replaced_count = ext4_swap_extents(handle, donor_inode, orig_inode, in move_extent_per_page()
423 ext4_double_up_write_data_sem(orig_inode, donor_inode); in move_extent_per_page()
425 ext4_error_inode_block(orig_inode, (sector_t)(orig_blk_offset), in move_extent_per_page()
448 mext_check_arguments(struct inode *orig_inode, in mext_check_arguments() argument
453 unsigned int blkbits = orig_inode->i_blkbits; in mext_check_arguments()
456 orig_eof = (i_size_read(orig_inode) + blocksize - 1) >> blkbits; in mext_check_arguments()
463 orig_inode->i_ino, donor_inode->i_ino); in mext_check_arguments()
471 if (IS_SWAPFILE(orig_inode) || IS_SWAPFILE(donor_inode)) { in mext_check_arguments()
474 orig_inode->i_ino, donor_inode->i_ino); in mext_check_arguments()
478 if (ext4_is_quota_file(orig_inode) && ext4_is_quota_file(donor_inode)) { in mext_check_arguments()
481 orig_inode->i_ino, donor_inode->i_ino); in mext_check_arguments()
486 if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) { in mext_check_arguments()
488 "based file [ino:orig %lu]\n", orig_inode->i_ino); in mext_check_arguments()
496 if ((!orig_inode->i_size) || (!donor_inode->i_size)) { in mext_check_arguments()
502 if ((orig_start & ~(PAGE_MASK >> orig_inode->i_blkbits)) != in mext_check_arguments()
503 (donor_start & ~(PAGE_MASK >> orig_inode->i_blkbits))) { in mext_check_arguments()
506 orig_inode->i_ino, donor_inode->i_ino); in mext_check_arguments()
517 orig_inode->i_ino, donor_inode->i_ino); in mext_check_arguments()
530 "[ino:orig %lu, donor %lu]\n", orig_inode->i_ino, in mext_check_arguments()
556 struct inode *orig_inode = file_inode(o_filp); in ext4_move_extents() local
559 int blocks_per_page = PAGE_SIZE >> orig_inode->i_blkbits; in ext4_move_extents()
564 if (orig_inode->i_sb != donor_inode->i_sb) { in ext4_move_extents()
567 orig_inode->i_ino, donor_inode->i_ino); in ext4_move_extents()
572 if (orig_inode == donor_inode) { in ext4_move_extents()
575 orig_inode->i_ino, donor_inode->i_ino); in ext4_move_extents()
580 if (!S_ISREG(orig_inode->i_mode) || !S_ISREG(donor_inode->i_mode)) { in ext4_move_extents()
583 orig_inode->i_ino, donor_inode->i_ino); in ext4_move_extents()
589 if (ext4_should_journal_data(orig_inode) || in ext4_move_extents()
591 ext4_msg(orig_inode->i_sb, KERN_ERR, in ext4_move_extents()
596 if (IS_ENCRYPTED(orig_inode) || IS_ENCRYPTED(donor_inode)) { in ext4_move_extents()
597 ext4_msg(orig_inode->i_sb, KERN_ERR, in ext4_move_extents()
603 lock_two_nondirectories(orig_inode, donor_inode); in ext4_move_extents()
606 inode_dio_wait(orig_inode); in ext4_move_extents()
610 ext4_double_down_write_data_sem(orig_inode, donor_inode); in ext4_move_extents()
612 ret = mext_check_arguments(orig_inode, donor_inode, orig_blk, in ext4_move_extents()
626 ret = get_ext_path(orig_inode, o_start, &path); in ext4_move_extents()
659 orig_inode->i_blkbits); in ext4_move_extents()
672 ext4_double_up_write_data_sem(orig_inode, donor_inode); in ext4_move_extents()
678 ext4_double_down_write_data_sem(orig_inode, donor_inode); in ext4_move_extents()
687 ext4_discard_preallocations(orig_inode, 0); in ext4_move_extents()
693 ext4_double_up_write_data_sem(orig_inode, donor_inode); in ext4_move_extents()
694 unlock_two_nondirectories(orig_inode, donor_inode); in ext4_move_extents()