inode.c (b21ebf143af219207214c79bc217beb39c43212a) inode.c (a80f7fcf18672ae4971a6b713b58c0d389aa99fe)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/inode.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 718 unchanged lines hidden (view full) ---

727 ret = ext4_jbd2_inode_add_wait(handle, inode,
728 start_byte, length);
729 else
730 ret = ext4_jbd2_inode_add_write(handle, inode,
731 start_byte, length);
732 if (ret)
733 return ret;
734 }
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/ext4/inode.c
4 *
5 * Copyright (C) 1992, 1993, 1994, 1995
6 * Remy Card (card@masi.ibp.fr)
7 * Laboratoire MASI - Institut Blaise Pascal
8 * Universite Pierre et Marie Curie (Paris VI)

--- 718 unchanged lines hidden (view full) ---

727 ret = ext4_jbd2_inode_add_wait(handle, inode,
728 start_byte, length);
729 else
730 ret = ext4_jbd2_inode_add_write(handle, inode,
731 start_byte, length);
732 if (ret)
733 return ret;
734 }
735 ext4_fc_track_range(inode, map->m_lblk,
735 ext4_fc_track_range(handle, inode, map->m_lblk,
736 map->m_lblk + map->m_len - 1);
737 }
738
739 if (retval < 0)
740 ext_debug(inode, "failed with err %d\n", retval);
741 return retval;
742}
743

--- 3362 unchanged lines hidden (view full) ---

4106 ret = ext4_ext_remove_space(inode, first_block,
4107 stop_block - 1);
4108 else
4109 ret = ext4_ind_remove_space(handle, inode, first_block,
4110 stop_block);
4111
4112 up_write(&EXT4_I(inode)->i_data_sem);
4113 }
736 map->m_lblk + map->m_len - 1);
737 }
738
739 if (retval < 0)
740 ext_debug(inode, "failed with err %d\n", retval);
741 return retval;
742}
743

--- 3362 unchanged lines hidden (view full) ---

4106 ret = ext4_ext_remove_space(inode, first_block,
4107 stop_block - 1);
4108 else
4109 ret = ext4_ind_remove_space(handle, inode, first_block,
4110 stop_block);
4111
4112 up_write(&EXT4_I(inode)->i_data_sem);
4113 }
4114 ext4_fc_track_range(inode, first_block, stop_block);
4114 ext4_fc_track_range(handle, inode, first_block, stop_block);
4115 if (IS_SYNC(inode))
4116 ext4_handle_sync(handle);
4117
4118 inode->i_mtime = inode->i_ctime = current_time(inode);
4119 ret2 = ext4_mark_inode_dirty(handle, inode);
4120 if (unlikely(ret2))
4121 ret = ret2;
4122 if (ret >= 0)

--- 1316 unchanged lines hidden (view full) ---

5439 * update c/mtime in shrink case below
5440 */
5441 if (!shrink) {
5442 inode->i_mtime = current_time(inode);
5443 inode->i_ctime = inode->i_mtime;
5444 }
5445
5446 if (shrink)
4115 if (IS_SYNC(inode))
4116 ext4_handle_sync(handle);
4117
4118 inode->i_mtime = inode->i_ctime = current_time(inode);
4119 ret2 = ext4_mark_inode_dirty(handle, inode);
4120 if (unlikely(ret2))
4121 ret = ret2;
4122 if (ret >= 0)

--- 1316 unchanged lines hidden (view full) ---

5439 * update c/mtime in shrink case below
5440 */
5441 if (!shrink) {
5442 inode->i_mtime = current_time(inode);
5443 inode->i_ctime = inode->i_mtime;
5444 }
5445
5446 if (shrink)
5447 ext4_fc_track_range(inode,
5447 ext4_fc_track_range(handle, inode,
5448 (attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
5449 inode->i_sb->s_blocksize_bits,
5450 (oldsize > 0 ? oldsize - 1 : 0) >>
5451 inode->i_sb->s_blocksize_bits);
5452 else
5453 ext4_fc_track_range(
5448 (attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
5449 inode->i_sb->s_blocksize_bits,
5450 (oldsize > 0 ? oldsize - 1 : 0) >>
5451 inode->i_sb->s_blocksize_bits);
5452 else
5453 ext4_fc_track_range(
5454 inode,
5454 handle, inode,
5455 (oldsize > 0 ? oldsize - 1 : oldsize) >>
5456 inode->i_sb->s_blocksize_bits,
5457 (attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
5458 inode->i_sb->s_blocksize_bits);
5459
5460 down_write(&EXT4_I(inode)->i_data_sem);
5461 EXT4_I(inode)->i_disksize = attr->ia_size;
5462 rc = ext4_mark_inode_dirty(handle, inode);

--- 233 unchanged lines hidden (view full) ---

5696 struct inode *inode, struct ext4_iloc *iloc)
5697{
5698 int err = 0;
5699
5700 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) {
5701 put_bh(iloc->bh);
5702 return -EIO;
5703 }
5455 (oldsize > 0 ? oldsize - 1 : oldsize) >>
5456 inode->i_sb->s_blocksize_bits,
5457 (attr->ia_size > 0 ? attr->ia_size - 1 : 0) >>
5458 inode->i_sb->s_blocksize_bits);
5459
5460 down_write(&EXT4_I(inode)->i_data_sem);
5461 EXT4_I(inode)->i_disksize = attr->ia_size;
5462 rc = ext4_mark_inode_dirty(handle, inode);

--- 233 unchanged lines hidden (view full) ---

5696 struct inode *inode, struct ext4_iloc *iloc)
5697{
5698 int err = 0;
5699
5700 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) {
5701 put_bh(iloc->bh);
5702 return -EIO;
5703 }
5704 ext4_fc_track_inode(inode);
5704 ext4_fc_track_inode(handle, inode);
5705
5706 if (IS_I_VERSION(inode))
5707 inode_inc_iversion(inode);
5708
5709 /* the do_update_inode consumes one bh->b_count */
5710 get_bh(iloc->bh);
5711
5712 /* ext4_do_update_inode() does jbd2_journal_dirty_metadata */

--- 485 unchanged lines hidden ---
5705
5706 if (IS_I_VERSION(inode))
5707 inode_inc_iversion(inode);
5708
5709 /* the do_update_inode consumes one bh->b_count */
5710 get_bh(iloc->bh);
5711
5712 /* ext4_do_update_inode() does jbd2_journal_dirty_metadata */

--- 485 unchanged lines hidden ---