repart: Rename partition_exclude/defer() to partition_type_exclude/defer()
This commit is contained in:
+14
-18
@@ -423,24 +423,20 @@ static void partition_foreignize(Partition *p) {
|
||||
p->verity = VERITY_OFF;
|
||||
}
|
||||
|
||||
static bool partition_exclude(const Partition *p) {
|
||||
assert(p);
|
||||
|
||||
static bool partition_type_exclude(GptPartitionType type) {
|
||||
if (arg_filter_partitions_type == FILTER_PARTITIONS_NONE)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < arg_n_filter_partitions; i++)
|
||||
if (sd_id128_equal(p->type.uuid, arg_filter_partitions[i].uuid))
|
||||
if (sd_id128_equal(type.uuid, arg_filter_partitions[i].uuid))
|
||||
return arg_filter_partitions_type == FILTER_PARTITIONS_EXCLUDE;
|
||||
|
||||
return arg_filter_partitions_type == FILTER_PARTITIONS_INCLUDE;
|
||||
}
|
||||
|
||||
static bool partition_defer(const Partition *p) {
|
||||
assert(p);
|
||||
|
||||
static bool partition_type_defer(GptPartitionType type) {
|
||||
for (size_t i = 0; i < arg_n_defer_partitions; i++)
|
||||
if (sd_id128_equal(p->type.uuid, arg_defer_partitions[i].uuid))
|
||||
if (sd_id128_equal(type.uuid, arg_defer_partitions[i].uuid))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1657,7 +1653,7 @@ static int partition_read_definition(Partition *p, const char *path, const char
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (partition_exclude(p))
|
||||
if (partition_type_exclude(p->type))
|
||||
return 0;
|
||||
|
||||
if (p->size_min != UINT64_MAX && p->size_max != UINT64_MAX && p->size_min > p->size_max)
|
||||
@@ -3130,7 +3126,7 @@ static int context_wipe_and_discard(Context *context) {
|
||||
if (!p->allocated_to_area)
|
||||
continue;
|
||||
|
||||
if (partition_defer(p))
|
||||
if (partition_type_defer(p->type))
|
||||
continue;
|
||||
|
||||
r = context_wipe_partition(context, p);
|
||||
@@ -3922,7 +3918,7 @@ static int context_copy_blocks(Context *context) {
|
||||
if (PARTITION_EXISTS(p)) /* Never copy over existing partitions */
|
||||
continue;
|
||||
|
||||
if (partition_defer(p))
|
||||
if (partition_type_defer(p->type))
|
||||
continue;
|
||||
|
||||
assert(p->new_size != UINT64_MAX);
|
||||
@@ -3960,14 +3956,14 @@ static int context_copy_blocks(Context *context) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (p->siblings[VERITY_HASH] && !partition_defer(p->siblings[VERITY_HASH])) {
|
||||
if (p->siblings[VERITY_HASH] && !partition_type_defer(p->siblings[VERITY_HASH]->type)) {
|
||||
r = partition_format_verity_hash(context, p->siblings[VERITY_HASH],
|
||||
/* node = */ NULL, partition_target_path(t));
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (p->siblings[VERITY_SIG] && !partition_defer(p->siblings[VERITY_SIG])) {
|
||||
if (p->siblings[VERITY_SIG] && !partition_type_defer(p->siblings[VERITY_SIG]->type)) {
|
||||
r = partition_format_verity_sig(context, p->siblings[VERITY_SIG]);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -4362,7 +4358,7 @@ static int context_mkfs(Context *context) {
|
||||
if (p->copy_blocks_fd >= 0)
|
||||
continue;
|
||||
|
||||
if (partition_defer(p))
|
||||
if (partition_type_defer(p->type))
|
||||
continue;
|
||||
|
||||
assert(p->offset != UINT64_MAX);
|
||||
@@ -4446,14 +4442,14 @@ static int context_mkfs(Context *context) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (p->siblings[VERITY_HASH] && !partition_defer(p->siblings[VERITY_HASH])) {
|
||||
if (p->siblings[VERITY_HASH] && !partition_type_defer(p->siblings[VERITY_HASH]->type)) {
|
||||
r = partition_format_verity_hash(context, p->siblings[VERITY_HASH],
|
||||
/* node = */ NULL, partition_target_path(t));
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (p->siblings[VERITY_SIG] && !partition_defer(p->siblings[VERITY_SIG])) {
|
||||
if (p->siblings[VERITY_SIG] && !partition_type_defer(p->siblings[VERITY_SIG]->type)) {
|
||||
r = partition_format_verity_sig(context, p->siblings[VERITY_SIG]);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -4782,7 +4778,7 @@ static int context_mangle_partitions(Context *context) {
|
||||
if (p->dropped)
|
||||
continue;
|
||||
|
||||
if (partition_defer(p))
|
||||
if (partition_type_defer(p->type))
|
||||
continue;
|
||||
|
||||
assert(p->new_size != UINT64_MAX);
|
||||
@@ -5031,7 +5027,7 @@ static int context_split(Context *context) {
|
||||
if (!p->split_path)
|
||||
continue;
|
||||
|
||||
if (partition_defer(p))
|
||||
if (partition_type_defer(p->type))
|
||||
continue;
|
||||
|
||||
fdt = open(p->split_path, O_WRONLY|O_NOCTTY|O_CLOEXEC|O_NOFOLLOW|O_CREAT|O_EXCL, 0666);
|
||||
|
||||
Reference in New Issue
Block a user