Whamcloud - gitweb
LU-9855 lustre: use with_imp_locked() more broadly. 95/39595/11
authorMr NeilBrown <neilb@suse.de>
Fri, 7 Aug 2020 02:05:35 +0000 (12:05 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 10 Mar 2021 08:03:42 +0000 (08:03 +0000)
commit168ec247779f3ab743985bdbad605f8eacd8fc81
treedbc207aea091b518f5121db484524f5f578b48c6
parent45a3e85f5c8924c85c0090e14748dc2cad366e53
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:
lustre/include/lprocfs_status.h
lustre/include/obd_class.h
lustre/ldlm/ldlm_flock.c
lustre/mdc/lproc_mdc.c
lustre/mdc/mdc_request.c
lustre/mgc/mgc_request.c
lustre/osc/lproc_osc.c
lustre/osc/osc_request.c
lustre/osp/lproc_osp.c
lustre/osp/osp_dev.c
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/sec_config.c