LU-3834 mdt: handle swap_layouts failures during restore

Actually nothing occur after swap_layouts failures during restore,
this can lead to file being left in incoherent state and thus be
unavailable because HS_RELEASED is clear but LOV_PATTERN_F_RELEASED
is still set.
This patch will allow original layout to be recovered by the use of
SWAP_LAYOUTS_MDS_HSM flag. Additionaly this requires HSM xattr of
the data FID to be set.
Also adds layout-swap failure injection and related test.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: Id0e9a005362e4a3854b33f6ce1888197d20e7dbf
Reviewed-on: http://review.whamcloud.com/7631
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4372 gss: Compatibility cache_register_net 2.6.x/3.3 kernel

Since 3.4 cache_register/cache_unregister are removed.
This patch provides a compatibility function to support
kernels 2.6.x to 3.3. Note, since 2.6.37
cache_register_net/cache_unregister_net are defined,
but not exported (no EXPORT_SYMBOL) and thus cannot
be loaded by the module loader. In 3.3
cache_register_net/cache_unregister_net
are exported. This patch is related to LU-4012.

Signed-off-by: Thomas Stibor <thomas@stibor.net>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Iaee5aa7e60e1bd08735c345f413a2344c2850f57
Reviewed-on: http://review.whamcloud.com/8528
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>