LU-1194 llog: fix for not sync llcd at thread stop

If llog_obd_repl_cancel() happend between llog_sync() and
class_import_put() at filter_llog_finish(), llog_recov_thread_stop()
throw LBUG. This patch fix this issue by adding new flags to llog_ctxt.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Reviewed-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Xyratex-bug-id: MRP-456
Change-Id: Ife79adfe6cde0f2090776cd27cd87f65c1e988e2
Reviewed-on: http://review.whamcloud.com/2789
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-723 ldiskfs: Drop support for ext3 based ldiskfs

Building ldiskfs from ext3 is no longer supported, thus this change
attempts to clean things up and only support building ldiskfs from
ext4 sources. The main changes made, involved replacing the @BACKFS@
autoconf variable with 'ext4', and removing the HAVE_EXT4_LDISKFS
macro. It is now safe to assume that ldiskfs is build based entirely
on ext4.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: Ia0eff6e4c1b755806ccfbf554e4a36201f9f1a64
Reviewed-on: http://review.whamcloud.com/1643
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-506 kernel: 2.6.38 kernel macro check cleanup

* HAVE_DCACHE_LOCK is used to mark kernel >= 2.6.38, instead of other
kernel macros, this makes it easier to maintain kernel support in
the future.
* minor cleanups.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ic9a6a8c339a10b34e2b1b06b47fd9e252cd3ec2c
Reviewed-on: http://review.whamcloud.com/3159
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
LU-56 ptlrpc: svc thread starting/stopping cleanup

This patch covered two things:
- serialize creation of ptlrpc service thread
  In current version we can parallel create service threads, so there
  could be "hole" of thread ID if one creation failed, it could be
  problemaic because some modules require thread ID to be strictly
  contiguous and unique. Serializing thread creation can resolve this
  issue.
- code cleanup for for stopping of ptlrpc servcie threads, this is
  just for the next step work of partitioned ptlrpc service.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Ied8ad89003aa9d53fa73a4e5166a2c8d07a1aae9
Reviewed-on: http://review.whamcloud.com/2912
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 ptlrpc: cleanup of ptlrpc_unregister_service

This patch is only a cleanup of ptlrpc_unregister_service(),
it's an intermediate patch for partitioned ptlrpc service.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I334fa3813f77711defd598bbb7f688d3ea6026be
Reviewed-on: http://review.whamcloud.com/2917
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 lnet: Partitioned LNet resources (ME/MD/EQ)

We already have a new lock lnet_res_lock to protect LNet resources,
but it's still a global lock and could have performance issue.
This patch created partitioned data for LNet, resources are
spreaded into different partitions. Also, lnet_res_lock is not
a single spinlock anymore, it's a percpt lock now, which means
LNet only needs to lock one partition at a time while operating
MD/ME belonging to that partition.

There are a few things are still serialized by exclusive lock:
- EQ allocation/free
- LNetEQPoll (non-zero size EQ)
- delay message on lazy portal
- Steaing MD between partitions.

There operations are either rare or deprecated so they shouldn't
become performance problem.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: If5e88b92dd508b84c0fd91725b3aaed424dd3108
Reviewed-on: http://review.whamcloud.com/3078
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-56 lnet: cleanup for rtrpool and LNet counter

This patch covered a few of things:
- code cleanup for router buffer pools
- code cleanup for error handling in lnet_prepare()
- code cleanup for LNet counters

This is an intermediate patch for LNet SMP improvements.

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