devlink: uniformly take the devlink instance lock in the dump loop
authorJakub Kicinski <kuba@kernel.org>
Thu, 5 Jan 2023 04:05:29 +0000 (20:05 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 06:13:39 +0000 (22:13 -0800)
commite4d5015bc11bcc5123ec8805d8c7f1e28a77a8a9
treece3c7144723b61a592a2bb70ea4058574c20cee3
parentc9666bac537e0f98ce15ea57c5fb25fc0a9a29b1
devlink: uniformly take the devlink instance lock in the dump loop

Move the lock taking out of devlink_nl_cmd_region_get_devlink_dumpit().
This way all dumps will take the instance lock in the main iteration
loop directly, making refactoring and reading the code easier.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/leftover.c