LU-5502 osp: add a high-level description of the OSP module

Add a high-level description of the OSP module to
lustre/osp/osp_dev.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I4dfcc3629032377aa7fa726b43fedb24680e5829
Reviewed-on: http://review.whamcloud.com/11562
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Richard Henwood <richard.henwood@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5496 ldlm: granting the same lock twice on recovery

the previous fix was not correct, check for resend before removing
from resource, otherwise conflicts can be granted in parallel.

also, some minor cleanups.

Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Change-Id: I461608878d40d6bba4e23179a7379de835d526c3
Reviewed-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
Tested-by: Alexander Lezhoev <alexander_lezhoev@xyratex.com>
Xyratex-bug-id: MRP-1944
Reviewed-on: http://review.whamcloud.com/11469
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
LU-4975 ofd: documenting lprocfs_ofd.c

Fix up GPL header block to reference proper GPLv2 license URL.
Remove mention of contacting Sun, since they don't exist anymore.
Add introductory comment block for the lprocfs_ofd.c file and add
function comment blocks to all functions in it.

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I16d7e0d7be72339d91ddd7a50e5ac233397a5e45
Reviewed-on: http://review.whamcloud.com/11149
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5385: HSM: do not call the JSON log function if no log is open

llapi_hsm_log_ct_registration() and llapi_hsm_log_ct_progress() are
very expensive (fid2path+allocations). Do not let them do anything
if llapi_hsm_write_json_event() is going to discard the JSON record.

Make llapi_hsm_log_ct_registration() and llapi_hsm_log_ct_progress()
static too.

Signed-off-by: frank zago <fzago@cray.com>
Change-Id: Ib10023968a1bd021694bca6338c0a962f58da19a
Reviewed-on: http://review.whamcloud.com/11164
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5452 lmv: release request in lmv_revalidate_slaves()

In lmv_revalidate_slaves() ensure that the request returned by
md_intent_lock() is properly released on all paths.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I35d63b248d0c80261ebc97f43722b0c547eb1aac
Reviewed-on: http://review.whamcloud.com/11326
Tested-by: Jenkins
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: define __user for userspace

Structures used by ioctl are shared with the kernel. Some of these
structures will have the __user annotation for sparse, and thus __user
needs to be defined in user space

Change-Id: I2a4087a2faea0849cc816515c4aa9871699acf55
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11480
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: add spare annotation __user wherever needed

This fixes sparse warnings such as:

  .../api-ni.c:1639:33: warning: incorrect type in argument 3
                             (different address spaces)
  .../api-ni.c:1639:33:    expected struct lnet_process_id_t
                             [noderef] [usertype] <asn:1>*ids
  .../api-ni.c:1639:33:    got struct lnet_process_id_t
                             [usertype] *<noident>

There is no code change.

Signed-off-by: frank zago <fzago@cray.com>
Change-Id: I683ce17935ce0cc76ce4b450bc3750b7bca4d9a8
Reviewed-on: http://review.whamcloud.com/11202
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: o2ib: make local functions static

This fixes sparse warnings such as:
  .../o2iblnd.c:424:1: warning: symbol 'kiblnd_get_peer_info' was not declared.
                        Should it be static?

This reduces the code size by 400 bytes.

The body of "the_o2iblnd" was moved at the end of the file, to avoid
having to declare some static prototypes.

Change-Id: I160a2cda3db1a581e0a961e0368d8ee6fd2781fd
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11255
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: o2ib: make local functions static

This reduces the code size by about 1KiB.

Change-Id: Ib01fe7b2b47f3add55a449473b304c8030758865
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11256
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: define __must_hold() for older kernels

Backport of sparse macro __must_hold(), introduced in linux kernel
commit 8529091e:

linux/compiler.h has macros to denote functions that acquire or release
locks, but not to denote functions called with a lock held that return
with the lock still held.  Add a __must_hold macro to cover that case.

Change-Id: Ic77304a5f78f1681cfc48a728a12759366bb2cb8
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11294
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: define __acquires, __releases and __must_hold for userspace

Some functions that are shared between userspace and the kernel have sparse
annotations. So we need to also define these annotations in userspace.

Change-Id: Ie1e55416554d3295ed61fe26615d5241faa53818
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11481
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: add sparse locking annotations

Adds __acquires / __releases / __must_hold sparse locking annotations to
several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
    - wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
    - unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
    - wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
    'cfs_hash_rw_unlock' - unexpected unlock

Change-Id: I91834ea62a2bc21ee853a80b0b266e3d0e960bc3
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: obd: make local functions static

This decreases the code by 150 bytes.

Change-Id: I517c53fe65d0b80f509b903a704eac8ef9f1130a
Signed-off-by: frank zago <fzago@cray.com>
Reviewed-on: http://review.whamcloud.com/11305
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5396: use gfp_t for gfp mask, instead of (unsigned) int

This fixes sparse warnings, such as:

  .../echo.c:670:62: warning: incorrect type in initializer
                              (different base types)
  .../echo.c:670:62:    expected int [signed] gfp_mask
  .../echo.c:670:62:    got restricted gfp_t

gfp_t was introduced in 2.6.14 (end of 2005), so that should
work all recent distributions.

Besides using gfp_t, there is no code change.

Signed-off-by: frank zago <fzago@cray.com>
Change-Id: I3464fb21c47c174c3a04cb512ce05e0e9de146fb
Reviewed-on: http://review.whamcloud.com/11200
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 build: assume __linux__ and __KERNEL__

Assume that __linux__is defined everywhere and that __KERNEL__ is
defined in most of lustre/.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ia04e7ed4c3ab3e8ca205e14eaa1824536aedd1e3
Reviewed-on: http://review.whamcloud.com/11437
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5482 build: lustre-tests depends on attr, rsync, lsof, perl

Tests use get/setfattr and rsync but never require
to install attr, rsync, lsof, perl packages.

Test-Parameters: clientdistro=el7
Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: Id6ec7f88e6f9e71f6f1c97f2bd6a40a70f62f53c
Reviewed-on: http://review.whamcloud.com/11433
Tested-by: Jenkins
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>