Skip to content

Commit

Permalink
disk: don't try search for partition type if already set
Browse files Browse the repository at this point in the history
Block devices can already set partition type at initialization
stage, so, in this case is no point in searching for partition type.

Signed-off-by: Alexey Romanov <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
  • Loading branch information
mRrvz authored and panicking committed Aug 8, 2024
1 parent 9daad11 commit 6b0c9f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions disk/part.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ void part_init(struct blk_desc *desc)

blkcache_invalidate(desc->uclass_id, desc->devnum);

if (desc->part_type != PART_TYPE_UNKNOWN) {
for (entry = drv; entry != drv + n_ents; entry++) {
if (entry->part_type == desc->part_type && !entry->test(desc))
return;
}
}

desc->part_type = PART_TYPE_UNKNOWN;
for (entry = drv; entry != drv + n_ents; entry++) {
int ret;
Expand Down

0 comments on commit 6b0c9f2

Please sign in to comment.