reiser4: make space_allocator's check_blocks() reusable.

Make check_blocks() return a boolean value (whether did the extent's
state match our expectations) instead of asserting success and crashing
system otherwise.
Also make it possible to check extents spanning multiple bitmap blocks.

The only user of reiser4_check_block() in its previous form has been updated
to assert on true return value.

Thus check_blocks() can now be reused by various parts of reiser4, e. g.
by the discard subsystem which will be added in next commits.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: add an implementation of "block lists", splitted off the discard code.

The block list is a less memory efficient, but ordered (and thus sortable)
implementation of the same concept as the blocknr_set.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: add reiser4_debug(): a conditional equivalent of reiser4_log().

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: discard support: initial implementation using extent lists.

Implementation details:

- deallocated extents are logged to a linked list/queue
- if an extent being added is adjacent to the last one, they are merged
  to prevent another allocation
- at commit time, the log is further sorted and extents are merged
- extents are further processed to align discard requests to erase unit
  boundaries, extending them to neighbour blocks if needed
- each erase unit is checked to be deallocated and submitted to discard
- processing stops at first failure (this does not fail atom commit)

For now (shortcomings):

- discard functionality is enabled unconditionally
- kernel-reported erase unit granularity and alignment offset are used
  as-is without any override (it may make sense in order to mitigate
  bogus values sometimes reported by kernel/hardware)
- processing each erase unit makes its own bitmap query to check
  allocation status; this is suboptimal when granularity is less than
  the block size (should not matter in practice as granularity almost
  never is that small)

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: discard support: enable discard functionality through a mount option.

Discard subsystem is now enabled conditionally, using "discard" mount option.
For now there is no auto-detection in either direction.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: discard support: refactor to use blocknr_list, optimize per-atom memory consumption.

->discard_set is replaced by combination of already existing ->delete_set and
newly added ->aux_delete_set, containing extents deallocated without BA_DEFER
(i. e. blocks of the wandered journal). When discard is enabled, storage of
both delete sets is enabled. They are stored using blocknr_lists, which are
spliced and sorted before discarding.

Otherwise, only ->delete_set is maintained, and it is stored using blocknr_set
which is more memory efficient but inherently unordered (so it cannot be used
for the discard algorithm).

The only semantic-significant change to existing code is that
reiser4_post_commit_hook() does not clear ->delete_set (instead, it is cleared
either by discard_atom() or as part of atom's destruction). This is OK because
->delete_set is not accessed after reiser4_post_commit_hook().

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>