Skip to content

Commit edbd05b

Browse files
fdmananakdave
authored andcommitted
btrfs: defrag: remove pointless list_del_init() in defrag_one_cluster()
There's no need to call list_del_init() against each entry when freeing the list, as the list is local and we are freeing the entry. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com>
1 parent b9e1071 commit edbd05b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/btrfs/defrag.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,10 +1319,8 @@ static int defrag_one_cluster(struct btrfs_inode *inode,
13191319
inode->root->fs_info->sectorsize_bits;
13201320
}
13211321
out:
1322-
list_for_each_entry_safe(entry, tmp, &target_list, list) {
1323-
list_del_init(&entry->list);
1322+
list_for_each_entry_safe(entry, tmp, &target_list, list)
13241323
kfree(entry);
1325-
}
13261324
if (ret >= 0)
13271325
*last_scanned_ret = max(*last_scanned_ret, start + len);
13281326
return ret;

0 commit comments

Comments
 (0)