LU-3494 libcfs: Add relocation function to libcfs heap

When changing the values of the node in the heap which might affect
its ranking, we have to remove the node from the heap, change the
values and then insert the node into the heap again. The process of
inserting into the heap might fail because of memory insufficiency.
Sometimes, it is not convienient and efficient for a caller to handle
such kind of failure.

This patch adds a new function to do the job.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I31ce530d750341f6479470ba61457d9ed03afed3
Reviewed-on: http://review.whamcloud.com/6743
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobbie Lind <bobbie.j.lind@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3557 mdt: fix open existing file with O_CREAT for ro mount

We should only return -EROFS for read only mount if we really
need to create the file in question.

Defer the check to mdt_reint_open() instead of mdt_intent_opc().

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Change-Id: I68f34ef7abbae934cfc3564a67ff70e5ab8a12b1
Reviewed-on: http://review.whamcloud.com/6893
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2744 build: fix 'data race condition' issues

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Ia9bad7782b6289e84c11e7998957c732508e10a5
Reviewed-on: http://review.whamcloud.com/6567
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_BLKDEV_PUT_2ARGS test

blkdev_put has taken two arguments since v2.6.28.
We can remove the test and dead code.

Change-Id: Ib0379f87f57ed6148750920d853604c0b2943278
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/5390
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_PROCFS_USERS test

In-procfs locking has been upstream since v2.6.23
We can remove the test and the dead code (lots of it). Further
review should be made to determine whether _lprocfs_lock is
still necessary at all.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ie5db5e5cf2b6699d3e4fd3301fab1d5497a02ea6
Reviewed-on: http://review.whamcloud.com/7084
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_LOCK_MAP_ACQUIRE test

lock_map_acquire has been in the upstream kernel since v2.6.27.
We can remove the test and dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I4ac4cb6c92f79408712b210eec11a9e350e6ccde
Reviewed-on: http://review.whamcloud.com/5369
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_UNREGISTER_BLKDEV_RETURN_INT test

unregister_blkdev has returned void since v2.6.23
We can remove the test and the dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ic303ed75516064e508a1f84e6d64a6fa2f10a340
Reviewed-on: http://review.whamcloud.com/5349
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_BIT_SPINLOCK_H test

bit_spinlock.h has been upstream since v2.6.17.
We can remove the test and the dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I2875ae150e58c6670a2b56ad56e2a101eb6676b7
Reviewed-on: http://review.whamcloud.com/5338
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: update LC_EXPORT_TRUNCATE_COMPLETE

The LC_EXPORT_TRUNCATE_COMPLETE is under the heading for RHEL4 patches
which is misleading. The test checks for:

- exported truncate_complete_page, which was never in a release
- remove_from_page_cache, exported in v2.6.35
- delete_from_page_cache, exported in v2.6.39, replaced
  removed_from_page_cache

Let's update the comments and move the test into a place in the list
where it makes sense at a glance.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I8e53cc10d72528f9107c375cd7bb8527a27fadbd
Reviewed-on: http://review.whamcloud.com/5335
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2800 autoconf: remove LC_LINUX_FIEMAP_H test

<linux/fiemap.h> has been upstream since v2.6.28
We can remove the test and the dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I26fbef49fa672e81bd23697c972d6f3fff0944b4
Reviewed-on: http://review.whamcloud.com/5342
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3434 build: disable automatic Git hook install

Don't automatically install the Git commit hooks for checking code
and commit message style into .git/hooks/{prepare-,}commit-msg.
This should be done manually by the developer and/or checked when
the patch is pushed to Gerrit.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ie44be3baa5f04eb71a3d7f76556c455fd5fa7052
Reviewed-on: http://review.whamcloud.com/7046
Reviewed-by: Ned Bass <bass6@llnl.gov>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3443 mdc: document mdc_rpc_lock

As this lock can be a bottleneck, clarifying why it is needed may be
helpful to those working on client performance.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: Ib617a99a51b65b1141e52a6f31d4431828203650
Reviewed-on: http://review.whamcloud.com/6593
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2800 autoconf: remove LC_FS_STRUCT_USE_PATH

struct fs_struct has been using struct path for working dirs
since v2.6.26.

We can remove the test and the dead code.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I647eff05fa927e6d8b9865009a3e920c7971b7c5
Reviewed-on: http://review.whamcloud.com/5359
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-358 tests: Add the branch and commit-id to the yml.

yaml.sh updated to provide the information requested in the JIRA the
change is simple and requires that LUSTRE_BRANCH and LUSTRE_REVISION
are defined, if they are not defined then the elements are left blank

Change-Id: Ie558660bdf9cde4290342ea4e807ed22fa42d32a
Signed-off-by: Chris Gearing <chris@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1629
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3316 obdclass: fix wrong device put in case of race

The ls_device_put() might be called from local_oid_storage_fini()
wrongly if mutex-protected check failed due to race

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: Ia2707d5db84b6bb6e9a5558c08b03028de8b9d50
Reviewed-on: http://review.whamcloud.com/6334
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>