LU-1303 lod: improvements and fixes

- osp_statfs() returns -ENOTCONN if the corresponded OST found
  not connected. this let us to remove few additional checks in
  the allocation policy functions.

- struct obd_statfs gets new field: os_fprecreated
  LOD uses this to skip OSPs with no objects ready to use

- osp_statfs() returns number of already precerated objects
  in new os_fprecreated field

- OS_STATE_DEGRADED is ignored on the first 2 passes in RR policy

- lod_alloc_specific() to verify and skip OSPs already used in
  striping

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I86351bc1dcca7182bc5adf4eb3e03c054e33e95f
Reviewed-on: http://review.whamcloud.com/4242
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-2150 ost: ost_brw_read() to ptlrpc_free_bulk_nopin()

since a643e38 (LU-2089) OST do not pin pages involved in
BULKs: this is done to prevent get/put on the pages which
were allocated as part of order N (>1) allocation with 0
refcounter. get/put on such a page leads to warning from
the kernel. in the original patch one code path was not
fixed, so this patch completes the change.

also, to prevent confusion, the patch removes couple macros:
ptlrpc_free_bulk() and ptlrpc_prep_bulk_page(). so now the
caller should specify whether ptlrpc should reference pages
or not.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: I8cf5f334e8f7edab0ad37678e1e8af18904a0be6
Reviewed-on: http://review.whamcloud.com/4256
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2193 ofd: look up FID to destroy before locking

If the MDS is replaying object destroys after recovery, then it may
be trying to destroy non-existent objects.  This can provoke spurious
errors in lvbo_init() due to the inability to populate the lock LVB.
Rather than quiet the useful error message from lvbo_init(), instead
do the object lookup on the to-be-destroyed FID first.  If lookup
fails to find an object, skip the object locking entirely since it
isn't needed and would just flood the console after recovery.

During destroy RPCs from the MDS, the ELC buffer is always empty, so
short-circuit the initial lock cancellation attempt that is useless.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Id6197f23773ea271e0cb0912b19585b3df500c1e
Reviewed-on: http://review.whamcloud.com/4276
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2083 build: install git commit hooks automatically

Install the Lustre Git commit hooks into .git/hooks/ by default when
autogen.sh is run, so that they are present when patches are being
committed.  This avoids the relatively common case where a new tree
is checked out by new or experienced developers and is missing the
commit hooks when patches are being submitted.

While the commit hooks are sure to be installed for in any tree that
was built, this isn't a guarantee that the hooks will be installed in
every tree that has a commit, but it is very likely to be the case.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I6a15420fb7a35b790c1e816c67e20a8004500c1e
Reviewed-on: http://review.whamcloud.com/4175
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Reviewed-by: Bruce Korb <bruce_korb@xyratex.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2107 util: Enhance l_getidenty to leverage 'nscd' cacheing

Replace getgrent() use with getgrouplist() in l_getidentity,
which would allow it to leverage the 'nscd' cache.

Xyratex-bug-id: MRP-643
Signed-off-by: Sergii Glushchenko <sergii_glushchenko@xyratex.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Iurii Golovach <iurii_golovach@xyratex.com>
Change-Id: I593abaeefe02cdb2d4f8761124bdd48477a7a22a
Reviewed-on: http://review.whamcloud.com/4223
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Iurii Golovach <iurii.golovach@gmail.com>
LU-1770 ptlrpc: introducing OBD_CONNECT_FLOCK_OWNER flag

After applying flock policy fix into the 1.8 users met with an issue
when 1.8 clients with a fixed flock policy recognized incorrectly by
2.x servers.
This flag is intended to present 1.8 clients with fixed flock policy
to let 2.x servers make flock policy recognition correctly.
Patches with functionality changes were attached on review in LU-1575

Xyratex-bug-id: MRP-489
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Signed-off-by: Iurii Golovach <iurii_golovach@xyratex.com>
Change-Id: Id00b496ad3f556f99be5e9218497399f18a00357
Reviewed-on: http://review.whamcloud.com/3722
Reviewed-by: Cory Spitz <spitzcor@cray.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>