to ensure the import doesn't disappear while being accessed
via procfs.
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I005c96b349e55646996fd0d265ab4dd1e2b9a1fa
Reviewed-on: https://review.whamcloud.com/41681
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
+ struct obd_import *imp;
unsigned int val;
int rc;
unsigned int val;
int rc;
- rc = obd_set_max_rpcs_in_flight(&obd->u.cli, val);
- if (rc)
- count = rc;
+ with_imp_locked(obd, imp, rc)
+ rc = obd_set_max_rpcs_in_flight(&obd->u.cli, val);
+ return rc ? rc : count;
}
LUSTRE_RW_ATTR(max_rpcs_in_flight);
}
LUSTRE_RW_ATTR(max_rpcs_in_flight);
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
{
struct obd_device *obd = container_of(kobj, struct obd_device,
obd_kset.kobj);
+ struct obd_import *imp;
- rc = obd_set_max_mod_rpcs_in_flight(&obd->u.cli, val);
- if (rc)
- count = rc;
+ with_imp_locked(obd, imp, rc)
+ rc = obd_set_max_mod_rpcs_in_flight(&obd->u.cli, val);
+ return rc ? rc : count;
}
LUSTRE_RW_ATTR(max_mod_rpcs_in_flight);
}
LUSTRE_RW_ATTR(max_mod_rpcs_in_flight);