Merge pull request #25565 from poettering/dissect-optimizations
two dissect-image.c optimizations/tweaks
This commit is contained in:
@@ -648,18 +648,11 @@ static int dissect_image(
|
||||
|
||||
label = blkid_partition_get_name(pp); /* libblkid returns NULL here if empty */
|
||||
|
||||
if (type.designator == PARTITION_HOME) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
SD_GPT_FLAG_NO_AUTO | SD_GPT_FLAG_READ_ONLY | SD_GPT_FLAG_GROWFS);
|
||||
|
||||
if (pflags & SD_GPT_FLAG_NO_AUTO)
|
||||
continue;
|
||||
|
||||
rw = !(pflags & SD_GPT_FLAG_READ_ONLY);
|
||||
growfs = FLAGS_SET(pflags, SD_GPT_FLAG_GROWFS);
|
||||
|
||||
} else if (type.designator == PARTITION_SRV) {
|
||||
if (IN_SET(type.designator,
|
||||
PARTITION_HOME,
|
||||
PARTITION_SRV,
|
||||
PARTITION_XBOOTLDR,
|
||||
PARTITION_TMP)) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
SD_GPT_FLAG_NO_AUTO | SD_GPT_FLAG_READ_ONLY | SD_GPT_FLAG_GROWFS);
|
||||
@@ -682,17 +675,6 @@ static int dissect_image(
|
||||
|
||||
fstype = "vfat";
|
||||
|
||||
} else if (type.designator == PARTITION_XBOOTLDR) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
SD_GPT_FLAG_NO_AUTO | SD_GPT_FLAG_READ_ONLY | SD_GPT_FLAG_GROWFS);
|
||||
|
||||
if (pflags & SD_GPT_FLAG_NO_AUTO)
|
||||
continue;
|
||||
|
||||
rw = !(pflags & SD_GPT_FLAG_READ_ONLY);
|
||||
growfs = FLAGS_SET(pflags, SD_GPT_FLAG_GROWFS);
|
||||
|
||||
} else if (type.designator == PARTITION_ROOT) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
@@ -811,6 +793,8 @@ static int dissect_image(
|
||||
if (pflags & SD_GPT_FLAG_NO_AUTO)
|
||||
continue;
|
||||
|
||||
fstype = "swap";
|
||||
|
||||
/* We don't have a designator for SD_GPT_LINUX_GENERIC so check the UUID instead. */
|
||||
} else if (sd_id128_equal(type.uuid, SD_GPT_LINUX_GENERIC)) {
|
||||
|
||||
@@ -832,17 +816,6 @@ static int dissect_image(
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
} else if (type.designator == PARTITION_TMP) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
SD_GPT_FLAG_NO_AUTO | SD_GPT_FLAG_READ_ONLY | SD_GPT_FLAG_GROWFS);
|
||||
|
||||
if (pflags & SD_GPT_FLAG_NO_AUTO)
|
||||
continue;
|
||||
|
||||
rw = !(pflags & SD_GPT_FLAG_READ_ONLY);
|
||||
growfs = FLAGS_SET(pflags, SD_GPT_FLAG_GROWFS);
|
||||
|
||||
} else if (type.designator == PARTITION_VAR) {
|
||||
|
||||
check_partition_flags(node, pflags,
|
||||
|
||||
Reference in New Issue
Block a user