LU-1786 build: Fix build for crc32 pclmulqdq

Old versions of gcc don`t know pextrd instruction. User mode
libcfs build had wrong dependency with ARCH variable defined.
PEXTRD marco was added for old gcc, wrong dependency was fixed.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Change-Id: I8821a1c25367f0f284a80192ed65d89808d1b2da
Reviewed-on: http://review.whamcloud.com/3801
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1512 oi: reuse idle OI blocks

With the system running, some OI blocks may become empty because
related files have been removed. Originally, these empty blocks
almost cannot be reused beause it always allocates new block for
new leaf or index node. Such space waste is an important reason
for the OI file size increasing quickly.

Now, when the non-released OI leaf node becomes empty, it will be
recycled into a per-OI based idle blocks pool, which is organized
as a series of tables. For each table, the on-disk format is:

+---------+---------+---------+---------+------+---------+-------+
|  magic  |  count  |  next   |  logic  |      |  logic  | free  |
|(16 bits)|(16 bits)|  table  |  blk #  | .... |  blk #  | space |
|         |         |(32 bits)|(32 bits)|      |(32 bits)|       |
+---------+---------+---------+---------+------+---------+-------+

The logic blk# for the first table is stored as "idle_blocks" in
the OI root node. In fact, there is padding field in the OI root
node after the "dx_countlimit". We will append the "idle_blocks"
just after the "dx_countlimit" to reuse part of the padding. So
it will not cause compatibility issues with old OI files.

Adjust the strategy for OI file block allocation: reuse empty block
in its idle blocks pool with priority; if such pool is empty, then
allocate new block from system volume.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I1bccc1cd9a4e1a16e4f51ac18e6b995ec85a0cf8
Reviewed-on: http://review.whamcloud.com/3153
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1518 mdd: Fixup mdd_{obf,dot_lustre}_obj_ops.

Define several missing md_object ops for .lustre/fid.  Unify
attribute handling for .lustre with that of normal md_objects.

Fixed several defects:
- use parent ops instead of child ops in mdo_create();
- skip version get for obf in mdt_obj_version_get();
- disable non-normal fid lookup in obf_lookup();

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Signed-off-by: Bob Glossman <bogl@whamcloud.com>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I89c5b37c822680b0ad1e23372e3e2be464f6a3d8
Reviewed-on: http://review.whamcloud.com/3726
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1693 obdfilter: Set bi_rw before calling bio_add_page()

In filter_do_bio() and osd_do_io() set bi_rw before calling
bio_add_page() so that the correct bio direction is used in
mgrge_bvec_fn().

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Change-Id: Ife34d5d89337ea7fea41b5844fd724211b05c670
Reviewed-on: http://review.whamcloud.com/3501
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1592 ldlm: protect obd_export:exp_imp_reverse's change

* Protect obd_export::exp_imp_reverse from reconnect and destroy race.
* Add an assertion in class_import_put() to catch race in the first
  place.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: If0abf6717456931c567d8d41c1d20fe49452e959
Reviewed-on: http://review.whamcloud.com/3684
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1302 llog: structures changes, llog_thread_info

Add changes in structures, introduce llog_thread_info,
protect llog header data with new lock.

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Id1438e69d8771880481e1a335d38d3e2d1635085
Reviewed-on: http://review.whamcloud.com/3631
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>