Revert "reiser4: fix reiser4_rename_common: memset (foo, 0, sizeof foo)."

This reverts commit 119348213165c57f225c1ed6ce2e4a3c03734beb.

Superseded by another patch.

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

. Fix up incorrect calculation of REISER4_SUPER_MAGIC_STRING size;
. Fix up incorrect initialization of dataonstack, dotdot_entry,
  dotdot_name variables in reiser4_rename_common().

Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
reiser4: fix reiser4_post_{commit,write_back}_hook() and their invocations.

- let all hooks be called from one place (reiser4_write_logs())
- don't call reiser4_post_write_back_hook() twice
- fix reiser4_post_write_back_hook(): call the correct method of space allocator

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
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: blocknr_list: use kmem_cache instead of kmalloc for allocating entries.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
reiser4: blocknr_set: use kmem_cache instead of kmalloc for allocating entries.

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

Now reiser4_post_write_back_hook() is used for discarding and completing
deferred deallocations. The invocation of this hook has been moved past
immediate deallocations in the wandered logs code. Also, when discard is
enabled, immediate deallocations are made deferred, and discard procedure
takes place before any deallocations are completed. This allows to avoid
costly bitmap checks at discard time.

Implementation details:

- before discarding, the delete set is sorted and extents are merged
- each extent is submitted to discard as-is (blocks in all extents
  are still marked as allocated at this point, so there can be no races)
- processing stops at first failure (this does not fail atom commit)

For now (shortcomings):

- extents are not padded to erase unit boundaries

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
Merge branch 'reiser4-3.2' into reiser4-3.4
Merge branch 'reiser4-3.4' into reiser4-3.10
Merge branch 'reiser4-3.10' into reiser4-3.12
Merge branch 'reiser4-3.12' into reiser4-3.14
Merge branch 'reiser4-3.14' into reiser4-3.15
reiser4: block_alloc: improve error handling in reiser4_grab_reserved().

In case of error in reiser4_grab_space(), return the original error code,
not -ENOSPC unconditionally.
reiser4: block_alloc: create a separate function for printing a superblock's block counters.
reiser4: block_alloc: add a BA_ALL flag for grabbing all possible space.
reiser4: block_alloc: implement exclusive space grabbing through read-write semaphores.

This is now used to augment the second pass of BA_CAN_COMMIT machinery.
reiser4: block_alloc: keep write lock on grab_semaphore until release of exclusively grabbed space.

This was the original intention.
reiser4: block_alloc: sanitize grab_enabled modifications.

- do not re-enable grab before doing second attempt in BA_CAN_COMMIT sequence;
- disable grab in reiser4_grab_space(), and only do that if not BA_FORCE.
reiser4: do not mess with grab_enabled; instead, use BA_FORCE.