X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Faxmap.c;h=7351e29725f4189b8178d9e6895efdbc276f61c0;hb=55348b420e618b1c5c50106261437fe948ef2132;hp=d9ad30bf5b9d679070b6e1767b4b978dba7c3940;hpb=bcd5abfa9f230bbe4365dad1289fdea1f5509f74;p=fio.git diff --git a/lib/axmap.c b/lib/axmap.c index d9ad30bf..7351e297 100644 --- a/lib/axmap.c +++ b/lib/axmap.c @@ -309,7 +309,7 @@ static uint64_t axmap_find_first_free(struct axmap *axmap, unsigned int level, uint64_t index) { unsigned long j; - int i; + int i, found = 0; /* * Start at the bottom, then converge towards first free bit at the top @@ -331,11 +331,12 @@ static uint64_t axmap_find_first_free(struct axmap *axmap, unsigned int level, * free bit at the next higher level */ index = (j << UNIT_SHIFT) + ffz(al->map[j]); + found = 1; break; } } - return index; + return found ? index : (uint64_t) -1ULL; } uint64_t axmap_first_free(struct axmap *axmap)