H A D | move_extent.c | 74 * @orig_inode: original inode structure to be released its lock first 79 ext4_double_up_write_data_sem(struct inode *orig_inode, ext4_double_up_write_data_sem() argument 82 up_write(&EXT4_I(orig_inode)->i_data_sem); ext4_double_up_write_data_sem() 262 struct inode *orig_inode = file_inode(o_filp); move_extent_per_page() local 266 unsigned long blocksize = orig_inode->i_sb->s_blocksize; move_extent_per_page() 270 int from = data_offset_in_page << orig_inode->i_blkbits; move_extent_per_page() 271 int blocks_per_page = PAGE_CACHE_SIZE >> orig_inode->i_blkbits; move_extent_per_page() 272 struct super_block *sb = orig_inode->i_sb; move_extent_per_page() 281 jblocks = ext4_writepage_trans_blocks(orig_inode) * 2; move_extent_per_page() 282 handle = ext4_journal_start(orig_inode, EXT4_HT_MOVE_EXTENTS, jblocks); move_extent_per_page() 296 ((orig_inode->i_size - 1) >> orig_inode->i_blkbits)) { move_extent_per_page() 298 tmp_data_size = orig_inode->i_size & (blocksize - 1); move_extent_per_page() 307 ((block_len_in_page - 1) << orig_inode->i_blkbits); move_extent_per_page() 309 data_size = block_len_in_page << orig_inode->i_blkbits; move_extent_per_page() 313 *err = mext_page_double_lock(orig_inode, donor_inode, orig_page_offset, move_extent_per_page() 325 ext4_double_down_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 328 unwritten = mext_check_coverage(orig_inode, orig_blk_offset, move_extent_per_page() 339 ext4_double_up_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 349 replaced_count = ext4_swap_extents(handle, orig_inode, move_extent_per_page() 354 ext4_double_up_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 369 ext4_double_down_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 370 replaced_count = ext4_swap_extents(handle, orig_inode, donor_inode, move_extent_per_page() 373 ext4_double_up_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 378 block_len_in_page << orig_inode->i_blkbits; move_extent_per_page() 385 create_empty_buffers(pagep[0], 1 << orig_inode->i_blkbits, 0); move_extent_per_page() 390 *err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0); move_extent_per_page() 403 *err = ext4_jbd2_file_inode(handle, orig_inode); move_extent_per_page() 428 ext4_double_down_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 429 replaced_count = ext4_swap_extents(handle, donor_inode, orig_inode, move_extent_per_page() 432 ext4_double_up_write_data_sem(orig_inode, donor_inode); move_extent_per_page() 434 EXT4_ERROR_INODE_BLOCK(orig_inode, (sector_t)(orig_blk_offset), move_extent_per_page() 446 * @orig_inode: original inode 457 mext_check_arguments(struct inode *orig_inode, mext_check_arguments() argument 462 unsigned int blkbits = orig_inode->i_blkbits; mext_check_arguments() 465 orig_eof = (i_size_read(orig_inode) + blocksize - 1) >> blkbits; mext_check_arguments() 472 orig_inode->i_ino, donor_inode->i_ino); mext_check_arguments() 480 if (IS_SWAPFILE(orig_inode) || IS_SWAPFILE(donor_inode)) { mext_check_arguments() 483 orig_inode->i_ino, donor_inode->i_ino); mext_check_arguments() 487 if (IS_NOQUOTA(orig_inode) || IS_NOQUOTA(donor_inode)) { mext_check_arguments() 490 orig_inode->i_ino, donor_inode->i_ino); mext_check_arguments() 495 if (!(ext4_test_inode_flag(orig_inode, EXT4_INODE_EXTENTS))) { mext_check_arguments() 497 "based file [ino:orig %lu]\n", orig_inode->i_ino); mext_check_arguments() 505 if ((!orig_inode->i_size) || (!donor_inode->i_size)) { mext_check_arguments() 511 if ((orig_start & ~(PAGE_MASK >> orig_inode->i_blkbits)) != mext_check_arguments() 512 (donor_start & ~(PAGE_MASK >> orig_inode->i_blkbits))) { mext_check_arguments() 515 orig_inode->i_ino, donor_inode->i_ino); mext_check_arguments() 526 orig_inode->i_ino, donor_inode->i_ino); mext_check_arguments() 535 "[ino:orig %lu, donor %lu]\n", orig_inode->i_ino, mext_check_arguments() 561 struct inode *orig_inode = file_inode(o_filp); ext4_move_extents() local 564 int blocks_per_page = PAGE_CACHE_SIZE >> orig_inode->i_blkbits; ext4_move_extents() 569 if (orig_inode->i_sb != donor_inode->i_sb) { ext4_move_extents() 572 orig_inode->i_ino, donor_inode->i_ino); ext4_move_extents() 577 if (orig_inode == donor_inode) { ext4_move_extents() 580 orig_inode->i_ino, donor_inode->i_ino); ext4_move_extents() 585 if (!S_ISREG(orig_inode->i_mode) || !S_ISREG(donor_inode->i_mode)) { ext4_move_extents() 588 orig_inode->i_ino, donor_inode->i_ino); ext4_move_extents() 594 if (ext4_should_journal_data(orig_inode) || ext4_move_extents() 596 ext4_msg(orig_inode->i_sb, KERN_ERR, ext4_move_extents() 602 lock_two_nondirectories(orig_inode, donor_inode); ext4_move_extents() 605 ext4_inode_block_unlocked_dio(orig_inode); ext4_move_extents() 607 inode_dio_wait(orig_inode); ext4_move_extents() 611 ext4_double_down_write_data_sem(orig_inode, donor_inode); ext4_move_extents() 613 ret = mext_check_arguments(orig_inode, donor_inode, orig_blk, ext4_move_extents() 626 ret = get_ext_path(orig_inode, o_start, &path); ext4_move_extents() 659 orig_inode->i_blkbits); ext4_move_extents() 672 ext4_double_up_write_data_sem(orig_inode, donor_inode); ext4_move_extents() 678 ext4_double_down_write_data_sem(orig_inode, donor_inode); ext4_move_extents() 690 ext4_discard_preallocations(orig_inode); ext4_move_extents() 696 ext4_double_up_write_data_sem(orig_inode, donor_inode); ext4_move_extents() 697 ext4_inode_resume_unlocked_dio(orig_inode); ext4_move_extents() 699 unlock_two_nondirectories(orig_inode, donor_inode); ext4_move_extents()
|