[PATCH] More random map fixes

Several optimizations and fixes:

- Add ->last_free_lookup as a cache for get_next_free_offset(). No point
  in iterating known full blocks.
- Reduce number of random loops to 5 for random map lookups, fallback to
  next free block instead of wasting cpu cycles. Was 50.
- get_next_free_block() needs to take file offset into account.
- Reverse order of retrieving buflen and offset, so we can trim
  and mark properly.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2 files changed