LU-1213 tests: remove duplicate parallel-scale variables

Remove the duplicate variables from parallel-scale.sh and
parallel-scale-nfs.sh. Those variables are defined inside
the corresponding functions in functions.sh.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I77ea061289296aeb8b138631f7a55090f52093c9
Reviewed-on: http://review.whamcloud.com/2306
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Cliff White <cliffw@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1406 ofd: setup local files for OFD

Setup local files needed for OFD work, initialize server data
and clients data upon OFD setup

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I1ec1fc9c07889009f1404eb26830c63cbbc9f451
Reviewed-on: http://review.whamcloud.com/2854
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1347 build: remove the vim/emacs modelines

Remove the expandtabs directive from vim modelines from test scripts
and autoconf files as well.  In some cases where a very large test
script has been using 4-space indents for a long time, add directives
for 4-space tabstops so that the formatting is not too ugly.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I115abb1ceea5744495bc189bc5a83e734b845d36
Reviewed-on: http://review.whamcloud.com/2698
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-1274 osc: Do not grab mutex of cl_lock for glimpse

Otherwise this will cause client eviction if that lock is being
flushed and OST happens to be slow to finish the IO.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I8cbd9c38a317f4afaf3b0e237efe55e4c0f991c2
Reviewed-on: http://review.whamcloud.com/2426
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
LU-1252 recovery: don't always swap nidtbl entries

Swap nidtbl entries only when server and client are using different
byte order.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I58ebe98e81040ec187f4ecd75020b7b84c7d8904
Reviewed-on: http://review.whamcloud.com/2410
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1323 llite: find_vma() should be protected by mmap_sem

It had been wrongly protected by page_table_lock since 2004.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: Id7b0341dc8c385ad57e195d94f4e76b6c5626515
Reviewed-on: http://review.whamcloud.com/2543
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-1305 lu: fid_is_acct function

a helper introduced in orion for new quota componenent

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Iee557fbd8f910c49b65e1b66330e6906d6efe975
Reviewed-on: http://review.whamcloud.com/2882
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1030 osc: move io data from lov_oinfo into osc_object

Cleanup the code and move io related data structure into osc_object
so that it will be easier to manage pages with red-black tree.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I7cd8d6278bb70b221351d9db4193c679f93aeb21
Reviewed-on: http://review.whamcloud.com/2009
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1030 clio: reimplement ll_fsync in clio way

A new clio operation CIT_FSYNC is added to forcibly synchorize data
on local client and OST.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I047471f819c00901907d4312a353095b44dd96a1
Reviewed-on: http://review.whamcloud.com/2460
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1461 Fix ppc64 build errors

Do not try to print u64 as %llu, on ppc64 it's translated into
long int, so we must use LP.64 macroses.

Signed-off-by: Oleg Drokin <green@whamcloud.com>
Change-Id: I14d1051b9427abab5c44582d3230352937643fa5
Reviewed-on: http://review.whamcloud.com/2994
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1438 quota: fix race in quota_chk_acq_common()

quota_check_common() & qctxt_adjust_qunit() uses different way
to check if quota is enforced on certain ID, which could result
in infinite loop in quota_chk_acq_common() when the QB/QI_SET
flag is cleared just after checking.

This patch used a non-instrusive way to fix this rare race.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ia8c5cb593abf515cf4dc041c63c8a247ebe0cd03
Reviewed-on: http://review.whamcloud.com/2996
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1299 clio: a combo patch to fix cl_lock

In this patch, the following issues are fixed:
* redefine cl_lock_error(). There are two kinds of error when
  enqueuing a cl_lock: internal errors return from server side and
  local error for example interrupted by signal when waiting for a
  lock. Obviously the latter one is not fatal so we shouldn't err the
  lock out;
* for fault handling, only signal SIGKILL and SIGTERM is not allowed;
* handle return code of ll_fault correctly;
* redefine ->unuse() to release resource it held if enqueuing lock
  failed;
* in cl_lock_hold_release(), only CLS_CACHED mode lock will be cached,
  for locks in other states, they will be cancelled voluntarily;
* fix the problem that cfs_block_sigs() is wrongly used as
  cfs_restore_sigs() and implementation of cfs_block_sigs() was wrong
* other minor fixes.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: Ice6d237d367c54bfd84a4a33cea8a4c1081e7696
Reviewed-on: http://review.whamcloud.com/2654
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-957 scrub: Ancillary work for LFSCK/OI scrub

1) New debug sub-system - 'D_LFSCK'
For Lustre fsck/scrub running trace.

2) New MDT mount option - 'noscrub'
To disable auto triggering OI scrub when MDT mounts up
or by RPC which accesses inconsistent OI mapping entry.

3) Any object which will be used when Lustre server mounts
   should not be added into OI files to guarantee that the
   Lustre server can start up even though OI files corrupt.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I8b1f1f1160db25ce05bd2d5688f9ff1507e3841b
Reviewed-on: http://review.whamcloud.com/2897
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-957 scrub: OSD layer cleanup for OI scrub

1) Abstract some common functions in OSD layer.
2) Call lu_object_put() in osd_object_find() under failure case.
3) Do not release buffer_head until all the needed contents have
   been accessed in osd_oi_index_create_one().

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I3e6880271ee73ec2c4638b02c7e9c55fc827bdf3
Reviewed-on: http://review.whamcloud.com/2551
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-957 scrub: OI scrub against ldiskfs

The OI scrub is totally implemented inside osd-ldiskfs,
and driven by the inode iterator. For each object with
normal fid, its fid in the LMA and related OI entry in
the OI file will be compared, if they are inconsistent,
then the OI entry will be updated.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I04d25b3433336fb63c312f795a8631328beb3aa7
Reviewed-on: http://review.whamcloud.com/2552
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1406 ofd: add connect functions

Patch adds connect functions and export init/fini

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I6535d37845863c269dc279c6acc8be8bb8c54432
Reviewed-on: http://review.whamcloud.com/2855
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-1408 debug: initialize debug_msg_data if needed

initialize the libcfs_debug_msg_data only if needed

Change-Id: Id80ea290b982153c86dae2f71c3d42753fa8848f
Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/2889
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
LU-56 lnet: add lnet_*_free_locked for LNet

LNet has a set of internal functions lnet_*_free to release LNet
message or LNet descriptors (EQ, MD, ME), they require caller to
hold LNET_LOCK on calling, this is somehow confusing because
lnet_*_alloc should be called w/o any lock.
This patch add another set of functions named as lnet_*_free_locked
to replace original lnet_*_free which require caller to hold lock,
and still provide lnet_*_free which can be called w/o any lock.

This patch is just the first step work for LNet SMP improvements.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I4686d83fc08695f117bf6b3b53d5ad56fb03bcd1
Reviewed-on: http://review.whamcloud.com/2919
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-56 lnet: abstract container for EQ/ME/MD

This patch implemented a simple resource container for LNet,
it also created several instances of it to manage different LNet
objects (EQ/ME/MD), instead of putting resources in global
table/list.
It's a work step of LNet SMP improvements, we will create instances
for each CPT in following patches.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I5e03d618a5c932f032b45b4acdbd4aec546cf9a9
Reviewed-on: http://review.whamcloud.com/2921
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 lnet: container for LNet message

Adding a simple message container to LNet, and use it to replace
global message queues and message finalizers.
It's a work step of LNet SMP improvements, we will create instances
for each CPT in following patches.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I00f79d7598c4cd1274d7b72f7c4b482d9df75b7a
Reviewed-on: http://review.whamcloud.com/2922
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>