Fix kvec overlapping comparison

The comparisons were a bit wrong when comparing overlaping kvec
endpoints.  We want to compare the starts and ends with the ends and
starts, respectively.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-12-08 23:35:52 -08:00
parent b251f91842
commit 967e90e5ef

View File

@@ -71,8 +71,8 @@ int scoutfs_kvec_memcmp(struct kvec *a, struct kvec *b)
int scoutfs_kvec_cmp_overlap(struct kvec *a, struct kvec *b, int scoutfs_kvec_cmp_overlap(struct kvec *a, struct kvec *b,
struct kvec *c, struct kvec *d) struct kvec *c, struct kvec *d)
{ {
return scoutfs_kvec_memcmp(a, c) < 0 ? -1 : return scoutfs_kvec_memcmp(b, c) < 0 ? -1 :
scoutfs_kvec_memcmp(b, d) > 0 ? 1 : 0; scoutfs_kvec_memcmp(a, d) > 0 ? 1 : 0;
} }
/* /*