Skip to content

Commit fab4c16

Browse files
Daniel Vacekaxboe
authored andcommitted
blk-cgroup: don't use removal safe list iterators
Commit f1c006f moved deletion of the list blkg->q_node from blkg_destroy() to blkg_free_workfn(). Switch to using the list iterators, as we don't need removal protection anymore. Signed-off-by: Daniel Vacek <neelx@redhat.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20240104180031.148148-1-neelx@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 458aa1a commit fab4c16

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

block/blk-cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,13 +575,13 @@ static void blkg_destroy(struct blkcg_gq *blkg)
575575
static void blkg_destroy_all(struct gendisk *disk)
576576
{
577577
struct request_queue *q = disk->queue;
578-
struct blkcg_gq *blkg, *n;
578+
struct blkcg_gq *blkg;
579579
int count = BLKG_DESTROY_BATCH_SIZE;
580580
int i;
581581

582582
restart:
583583
spin_lock_irq(&q->queue_lock);
584-
list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) {
584+
list_for_each_entry(blkg, &q->blkg_list, q_node) {
585585
struct blkcg *blkcg = blkg->blkcg;
586586

587587
if (hlist_unhashed(&blkg->blkcg_node))

0 commit comments

Comments
 (0)