LU-4786 osc: to not pick busy pages for ELC

This is a combination of commit 154fb1f7 from LU-3321 and commit
bfae5a4e from LU-4300. This patch is only required in b2_5 as the
code is already in 2.6.

Use weigh_ast to decide if a lock covers any pages.
In recovery, weigh_ast will be used to decide if a DLM read lock
covers any locked pages, or it will be canceled instead being
recovered.

The problem with the original implementation is that it attached
each osc_page to an osc_lock also changed lock state to add every
pages for readahead.

Bugzilla-bug-Id: b=16774

Change the policy of ELC to pick locks that have no dirty pages,
no page in writeback state, and no locked pages.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ie857a4dd4e235f0c3273f53cbfab9592c2793ac9
Reviewed-on: http://review.whamcloud.com/10795
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4920 quota: always clear lqe_lockh on lock cancel

In the qsd_id_blocking_ast(), lqe_lockh should always be cleared,
otherwise, quota code will mistakenly assume the id lock is still
valid.

Lustre-change: http://review.whamcloud.com/9965/
Lustre-commit: 73ef5dcd8bcf32e4127e0011357b8bc39472cdba

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I653e263176a5415ec32324479fed86d948958ef0
Reviewed-on: http://review.whamcloud.com/11278
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>