LU-506 kernel: remove BKL fix

Commit I8a3432ad56b7a1fcdbf74be4b7819edb31bf6272 has defect; it's
fixed in this patch:
* use #ifdef instead of #if for HAVE_KERNEL_LOCKED check.
* in case of HAVE_KERNEL_LOCKED, a mntput() is missed if kernel is
  not locked.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I5c93252dc02e0ff90ce108701f9d847e4ee2e4e6
Reviewed-on: http://review.whamcloud.com/2928
Tested-by: Hudson
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
iupdate to new tag 2.2.54

Change-Id: I1676f95d0a9d3021c2c02aa010096503a523c745
Signed-off-by: Oleg Drokin <green@whamcloud.com>
LU-1406 ofd: OFD module framework

The very basic functionality, obd_device plus lu_device,
no methods so far. Can be built and run but do nothing.

For ability to use OFD the test-framework check shell variable
USE_OFD and loads ofd.ko instead of obdfilter

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I2797f375aec63204eca9d435cf837636e84e09bd
Reviewed-on: http://review.whamcloud.com/2792
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1406 ofd: OFD to setup device stack on OSD

Device stack initialization on top of OSD.
Pass through device and object methods to lower layer - OSD
Fix issue with osd_compat_init()

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: If3659f4a1dedfd579f65be64372f7531536852a3
Reviewed-on: http://review.whamcloud.com/2803
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1406 ofd: init lu_target in OFD

initialize LUT infrastructure, redo lut_init() to use
dt_find_or_create() instead of dt_store_open, add object methods

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I22602aeed7b2efd1b240f912b7a9fd34ba38dcc8
Reviewed-on: http://review.whamcloud.com/2804
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1217 osc: to not check a cl_lock's state w/o protection

osc_page_putref_lock() used to check cl_lock's refcount and
corresponding osc_lock's ols_hold without any protection, this
is racy because other process can change the lock state so as to
make the assertion be false.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I65fe1fa7fc55e8642fea6789784d7bb92a45d56f
Reviewed-on: http://review.whamcloud.com/2616
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-694 ptlrpc: Job Stats

This feature is to collect filesystem operation stats for the jobs
running on Lustre.

When some job scheduler (SLURM, for instance) is running on lustre
client, the lustre client will pack the job id into each request
(open, unlink, write...), and server will collect those information
then expose them via procfs.

- A 'pb_jobid' is added in 'ptlrpc_body' for storing the jobID;
- The job stats can be accessed from the proc file 'job_stats' in
  each mdt & obdfilter proc entries;
- 'job_cleanup_interval' is created in each mdt & obdfilter proc
  entries for tuning stats cleanup interval;
- 'jobid_var' is created in llite proc entry for configuring the
  jobID environment variable name;

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I35c21f93d7ce1ce648504ce437fcfd374f891453
Reviewed-on: http://review.whamcloud.com/1397
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-694 config: make 'jobid_var' global

This patch makes the global parameter able to accept
string value, and move the 'jobid_var' from the llite
folder into the lustre proc root /proc/fs/lustre.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ibaac19d2f29f8631d4717c6b0f82853cff64fc96
Reviewed-on: http://review.whamcloud.com/2785
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-56 libcfs: NUMA allocator and code cleanup

This patch covered a few things:
- Implementation of NUMA allocaters based on concept of CPU
  partition
- Add macros of NUMA allocators for both libcfs and OBD
- cleanup OBD allocaters
- A minor fix for llite, it's using GFP flag which should be
  CFS_ALLOC flag

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I5441a504d5df217b59b5db59e37ddb4855e7ae49
Reviewed-on: http://review.whamcloud.com/2523
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1347 lvfs: makes EXPORT_SYMBOL follows function body

Makes EXPORT_SYMBOL macros immediately follow the function body,
to follow normal Linux kernel coding style.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: Icf63514a8ad173217b55f115b4e4ada695eb9295
Reviewed-on: http://review.whamcloud.com/2838
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1347 style: removes obsolete EXPORT_SYMTAB macros

EXPORT_SYMTAB is obsolete after 2.4 kernel, this patch removes
all EXPORT_SYMTAB macros from source code.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: I5fe3a5544d0cdb45f8d40cd5828a18ea3e1ad26a
Reviewed-on: http://review.whamcloud.com/2671
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1364 utils: add lfs 'poollist' subcommand

Instead of adding a new subcommand this updates
the lfs man page.  pool_list is the preferred usage,
we just make all the docs match.

Signed-off-by: Bob Glossman <bogl@whamcloud.com>
Change-Id: I3f0a6692923e4ff8359afc8a3558ee404ffc4365
Reviewed-on: http://review.whamcloud.com/2734
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Richard Henwood <rhenwood@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1363 llite: Not held lock when calling security_d_instantiate

security_d_instantiate() could allocate momory and/or yield cpu, don't
held spin lock.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I0a32e067e21ec5f3d8427db020ae5fda6ce96ba1
Reviewed-on: http://review.whamcloud.com/2641
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1417 lov: device type finalized twice

lov_exit and osc_exit explicitly called lu_device_type_fini() right
before calling class_unregister_type().

However class_unregister_type() will call lu_device_type_fini() too,
which means lov_device_type and osc_device_type will be finalized
twice.

This can be fixed by removing lu_device_type_fini() calls from
lov_exit and osc_exit.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I12dea692f4d2bdd75bb1640b71c6dcc392b94478
Reviewed-on: http://review.whamcloud.com/2823
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-56 libcfs: export a few symbols from libcfs

Export cfs_trace_copyin_string and cfs_strncasecmp from libcfs,
These symbols will be used by LNet patches soon.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I8722adec822f9d90322a59ff71afff87a9062efd
Reviewed-on: http://review.whamcloud.com/2920
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-988 llite: add debugging for inode timestamps

Intermittent test failures for sanity.sh test_39j are showing the
inode timestamps going backward. Add internal debugging to track the
LVB timestamps to see where the old timestamps are coming from, to
determine if this is a problem with the VM environment being used for
testing, or if it is a genuine problem in the Lustre code.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Iae09d2361e81c05ccc5883dd4418067d9a90abab
Reviewed-on: http://review.whamcloud.com/2274
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1384 mdd: validate incoming param to avoid crashing

MDS get crashed when it is connected by old 1.8.x client, the crash
point is

kernel:LustreError: 3657:0:(mdd_object.c:635:mdd_big_lmm_get())
			ASSERTION( ma->ma_lmm_size > 0 ) failed

We need validate the incoming @ma lest old client crashes the MDS.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Iebdce6396318a2c6ee413a03dc76c122e3f84146
Reviewed-on: http://review.whamcloud.com/2905
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-56 libcfs: more common APIs in libcfs

Implementation of some common APIs:
- per-cpu-partition (percpt) data allocators
- implementation of per-cpu-partition lock
- a few other functions

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Ib303b79ee9be87cc306da7e2feb20c8c296b8ac6
Reviewed-on: http://review.whamcloud.com/2558
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1291 mds: Test failure on test suite replay-single 44c

The obd_notify needs protect by mds_notify_lock. Else LOV
maybe gone while __mds_lov_synchronize be called.

Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: Icb856b2a2b135711fd5681b0b4ebef0a1d78b988
Reviewed-on: http://review.whamcloud.com/2708
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1282 misc: Use present cpu numbers to save memory.

lprocfs stats data should allocated by the number of present cpus in
stead of by possible cpu number which wastes a lot of memory.

When new cpus are hot-plugged in, alloc necessary percpu array
elements on demand.

OSS minimum thread number also better be decided by online cpu
number.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Id1690f185f4f83fae75be7eddb756e413cbc4fba
Reviewed-on: http://review.whamcloud.com/2451
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>