Skip to content

Commit c000dfe

Browse files
jankaratytso
authored andcommitted
ext4: Drop special handling of journalled data from extent shifting operations
Now that filemap_write_and_wait() makes sure pages with journalled data are safely on disk, ext4_collapse_range() and ext4_insert_range() do not need special handling of journalled data. Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230329154950.19720-7-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent e360c6e commit c000dfe

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

fs/ext4/extents.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5290,13 +5290,6 @@ static int ext4_collapse_range(struct file *file, loff_t offset, loff_t len)
52905290
punch_start = offset >> EXT4_BLOCK_SIZE_BITS(sb);
52915291
punch_stop = (offset + len) >> EXT4_BLOCK_SIZE_BITS(sb);
52925292

5293-
/* Call ext4_force_commit to flush all data in case of data=journal. */
5294-
if (ext4_should_journal_data(inode)) {
5295-
ret = ext4_force_commit(inode->i_sb);
5296-
if (ret)
5297-
return ret;
5298-
}
5299-
53005293
inode_lock(inode);
53015294
/*
53025295
* There is no need to overlap collapse range with EOF, in which case
@@ -5443,13 +5436,6 @@ static int ext4_insert_range(struct file *file, loff_t offset, loff_t len)
54435436
offset_lblk = offset >> EXT4_BLOCK_SIZE_BITS(sb);
54445437
len_lblk = len >> EXT4_BLOCK_SIZE_BITS(sb);
54455438

5446-
/* Call ext4_force_commit to flush all data in case of data=journal */
5447-
if (ext4_should_journal_data(inode)) {
5448-
ret = ext4_force_commit(inode->i_sb);
5449-
if (ret)
5450-
return ret;
5451-
}
5452-
54535439
inode_lock(inode);
54545440
/* Currently just for extent based files */
54555441
if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {

0 commit comments

Comments
 (0)