summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-11-23 06:42:52 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-11-28 12:49:00 -0800
commit78a99fe6254cad4be310cd84af39f6c46b668c72 (patch)
treec5f487d62912f50eda77d6cbd059a1e5ded50545 /fs/f2fs
parent620816393239890feff8608251e2746b1cc2cfa0 (diff)
downloadlinux-78a99fe6254cad4be310cd84af39f6c46b668c72.tar.bz2
f2fs: truncate blocks in batch in __complete_revoke_list()
Use f2fs_do_truncate_blocks() to truncate all blocks in-batch in __complete_revoke_list(). Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/segment.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 14ece4bf7c7e..37c721e1eb03 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -262,24 +262,19 @@ static void __complete_revoke_list(struct inode *inode, struct list_head *head,
bool revoke)
{
struct revoke_entry *cur, *tmp;
- pgoff_t start_index = 0;
bool truncate = is_inode_flag_set(inode, FI_ATOMIC_REPLACE);
list_for_each_entry_safe(cur, tmp, head, list) {
- if (revoke) {
+ if (revoke)
__replace_atomic_write_block(inode, cur->index,
cur->old_addr, NULL, true);
- } else if (truncate) {
- f2fs_truncate_hole(inode, start_index, cur->index);
- start_index = cur->index + 1;
- }
list_del(&cur->list);
kmem_cache_free(revoke_entry_slab, cur);
}
if (!revoke && truncate)
- f2fs_do_truncate_blocks(inode, start_index * PAGE_SIZE, false);
+ f2fs_do_truncate_blocks(inode, 0, false);
}
static int __f2fs_commit_atomic_write(struct inode *inode)