block: use disk_part_iter_exit in disk_part_iter_next
authorChristoph Hellwig <hch@lst.de>
Tue, 10 Nov 2020 05:48:53 +0000 (06:48 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Dec 2020 21:53:39 +0000 (14:53 -0700)
Call disk_part_iter_exit in disk_part_iter_next instead of duplicating
the functionality.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c

index 4e03952..0bd9c41 100644 (file)
@@ -227,8 +227,7 @@ struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter)
        int inc, end;
 
        /* put the last partition */
        int inc, end;
 
        /* put the last partition */
-       disk_put_part(piter->part);
-       piter->part = NULL;
+       disk_part_iter_exit(piter);
 
        /* get part_tbl */
        rcu_read_lock();
 
        /* get part_tbl */
        rcu_read_lock();