LU-709 compat: remove all reference to LINUX_VERSION_CODE

All LINUX_VERSION_CODE refereces are used to note kernel version older
than 2.6.18. So we can drop them all.

Affected variables are inlined as much as possible to minimize compat
code definition.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: If3b94ceb5e21db8f96b11526399e9cd8f174fd6f
Reviewed-on: http://review.whamcloud.com/3442
Tested-by: Hudson
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-709 build: clean up LC_NR_PAGECACHE/LC_STATFS_DENTRY_PARAM

1. nr_pagecache is not exported from 2.6.18 to latest
2. super_operations->statfs takes dentry instead of superblock
   as first parameter since v2.6.18

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I93fd5cdd81b83f0896a1305f5b625fa0c82ef515
Reviewed-on: http://review.whamcloud.com/2319
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-709 build: cleanup LC_FLUSH_OWNER_ID/INVALIDATE_MAPPING

1. file_opeartions.flush takes fl_owner_t argument since v2.6.18
2. HAVE_INVALIDATE_MAPPING_PAGES and HAVE_INVALIDATE_INODE_PAGES
   are not used in Lustre

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I3674b032470973ee6b2be5bd05bb7ecc1311d107
Reviewed-on: http://review.whamcloud.com/2322
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-709 build: cleanup LC_PAGE_CHECKED and LC_INODE_BLKSIZE

1. kernel has PageChecked() and SetPageChecked() since v2.6.18
2. struct inode doesn't have i_blksize since v2.6.18

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Ic50941948ae409ea526108f43e1337db2141ae3d
Reviewed-on: http://review.whamcloud.com/2323
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1648 llog: prevent journal to restart for llog cancel

Journal credit for llog cancel should include the blocks for
deleting the inode. Otherwise the journal handle may need to
be restarted during the transaction for more credit. Then it
may be blocked with holding llog_handle::lgh_lock, which may
cause deadlock with other llog operations those have started
journal handle but waiting for the llog_handle::lgh_lock.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I157093cbe9e625715ec033f59dde325e81ec6b71
Reviewed-on: http://review.whamcloud.com/3463
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1410 test: Allow sanity test 200 to work with one OST

The sanity test is failing test 200 with one OST. When
the test adds machines to the pool it is not passing
valid arguments.

Changing first_ost=0 is allowing the test to run.

Signed-off-by:Keith Mannthey <keith@whamcloud.com>
Change-Id: I45aef14e7814f170024c71f904b888423d8f8c90
Reviewed-on: http://review.whamcloud.com/3730
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1407 msg: Wrong error messages on MDS and Client

Don't show error messages on console in some case.

Signed-off-by: yang sheng <ys@whamcloud.com>
Change-Id: I0b8b1bb523f677813b2f3998509afba639398d9d
Reviewed-on: http://review.whamcloud.com/3076
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1400 test: obdfilter-survey tests fail but still green

obdfilter-survey tests are failing but appear green in Maloo.
ENOSPACE errors are not being properly reported.

Add the "set -e" flag to make obdfilter-survey fail on errors.

Test-Parameters: testlist=obdfilter-survey
Signed-off-by: Keith Mannthey <keith@whamcloud.com>
Change-Id: I83666d085136178737727080a1a3b55768fb13a7
Reviewed-on: http://review.whamcloud.com/3591
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Li Wei <liwei@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1014 mountconf: MGS update timeout upon config update

MGS should update obd/ldlm_timeout upon MDS/OST config update. It
will be the largest value of all servers.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ia0786475fa5608e06f8c2606f87f98192a870df5
Reviewed-on: http://review.whamcloud.com/2881
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-1661 tests: improve setup_posix_users()

This patch improves setup_posix_users() in posix.cfg to use
do_rpc_nodes to add groups and users on remote nodes,
so as to simplify add_group() and add_user() and make them
become common functions to be used by other test scripts.

Test-Parameters: clientdistro=el5 testlist=posix
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Ie07f32dffe7d7ae2037d92bab372977efff2e5fe
Reviewed-on: http://review.whamcloud.com/3770
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.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-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-911 osd: use struct obd_statfs instead of kstatfs_t

OSD API and users to use struct obd_statfs.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I6bd98a632db9cd9f6ee4309c29d878a61bd7a228
Reviewed-on: http://review.whamcloud.com/1837
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-1304 mdt: cache statfs in mdt_device

... and save few cycles

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ib3727c7419cfdfa393a2c1c72770ef960b1d05e6
Reviewed-on: http://review.whamcloud.com/3780
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1304 mdt: use slab for mdt_objects

should save a bit of memory and cpu

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I13601aba3c2cdb5e7c0f4c3a45ff5fb6e428b38f
Reviewed-on: http://review.whamcloud.com/3781
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
LU-1304 mdd: use slab for mdd objects

taken from orion

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I52c415a92e271732436182f61d861467d7514dc4
Reviewed-on: http://review.whamcloud.com/3864
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
LU-1304 mdd: remove partial operations

DNE is implementing this by different means

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ieed255381672646277af370989416fd1421d29fb
Reviewed-on: http://review.whamcloud.com/3865
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1877 mdt: initialize lock and expiration

for statfs cache.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ief24f6a855c3ed14a7afc142921b9b249ab11604
Reviewed-on: http://review.whamcloud.com/3946
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1779 tests: fix run_one_logged() to log SKIP status

In the current test framework, only those tests which are in the
$ALWAYS_EXCEPT list are logged with SKIP status, other skipped
tests are all logged with PASS status.

This patch fixes the above issue by setting the SKIP status in
pass() and logging the status in run_one_logged().

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Ia4e8f51040034abdec9c67aaf0a128b63baaa688
Reviewed-on: http://review.whamcloud.com/3810
Tested-by: Hudson
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-80 mds: use md_size supplied by client, repack reply

- mdt uses only client easize to pack reply buffer with the same
buffer sizes as client has.
- introduce reply growing, when packing reply the proper MD size
might be unknown so clients data is being used, but after request
processing the proper size may be bigger than client expects and
reply buffer must be re-packed.
- if server data doesn't fit in buffer then it allocates bigger
buffer instead of using reply message buffer.
- rename mdt_shrink_reply into mdt_fix_reply. It does shrink and/or
grow when needed. Upon growing the bigger MD is copied into new
reply.
- server unpacks ea attr size always in mdt_reint_record for all
operation, so it is available always in rr_eadatasize.

Port from: ORI-80
Author: Mikhail Pershin <tappro@whamcloud.com>

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: Ieae6a1d4d07fdf7643ca6900d02d0dd962a07f6c
Reviewed-on: http://review.whamcloud.com/1808
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>