diff options
author | NeilBrown <neilb@suse.de> | 2011-02-01 14:44:02 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-01 14:44:02 +1100 |
commit | e5508b361d970a7657c9f81303223fa114bdcd9b (patch) | |
tree | bb4e33ec35abc0938bc8f9e2cb69ab5aee7c1cb7 /Incremental.c | |
parent | d11128690b61e61c1ff12b2c4b3d7028a0715b1d (diff) |
Allow domain_test to report that no domains were found.
Sometime we will need to know the difference between no domains found
and domains didn't match.
So allow domain_test to return different values and fix up all callers
to maintain current behaviour.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Incremental.c b/Incremental.c index 0d0a1fdc..52558e40 100644 --- a/Incremental.c +++ b/Incremental.c @@ -995,7 +995,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, } dl = domain_from_array(sra, st2->ss->name); - if (!domain_test(dl, pol, st2->ss->name)) { + if (domain_test(dl, pol, st2->ss->name) != 1) { /* domain test fails */ if (verbose > 1) fprintf(stderr, Name ": not adding %s to %s as" @@ -1111,7 +1111,7 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol, pol2 = path_policy(de->d_name, type_disk); domain_merge(&domlist, pol2, st ? st->ss->name : NULL); - if (domain_test(domlist, pol, st ? st->ss->name : NULL) == 0) + if (domain_test(domlist, pol, st ? st->ss->name : NULL) != 1) /* new device is incompatible with this device. */ goto next; @@ -1137,7 +1137,7 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol, if (!st) { /* Check domain policy again, this time referring to metadata */ domain_merge(&domlist, pol2, st2->ss->name); - if (domain_test(domlist, pol, st2->ss->name) == 0) + if (domain_test(domlist, pol, st2->ss->name) != 1) /* Incompatible devices for this metadata type */ goto next; if (!policy_action_allows(pol, st2->ss->name, act_spare)) |