Whamcloud - gitweb
LU-9855 lustre: use with_imp_locked() more broadly.
Several places in lustre take u.cli.cl_sem to protect access to
u.cli.cl_import, and so could use with_imp_locked() achieving cleaner
code.
Using with_imp_locked() in functions calling
ptlrpc_set_import_active() requires care as that function gets a
write-lock on ->cl_sem. So they need to use with_imp_locked() only to
get a counted reference on the imp, and must drop the lock before
calling ptlrpc_set_import_active().
This patch makes those changes and also:
- introduces with_imp_locked_nested() for sptlrpc_conf_client_adapt(),
- re-indents obd_cleanup_client_import(), which is only tangentially
related the the main purpose of this patch,
- removes code in ldlm_flock_completion_ast() which takes a copy
of cl_import, and doesn't use it.
- adds with_imp_locked() to two functions named 'active_store' which
weren't using it but should
- removes with_imp_locked() from ping_show() and instead includes it
in ptlrpc_obd_ping() where 'imp' is actually used.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I01a713c200a1698af222bc72cf4f955227a98305
Reviewed-on: https://review.whamcloud.com/39595
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
13 files changed: