devlink: add function to take snapshot while locked
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 26 Mar 2020 18:37:11 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 02:39:26 +0000 (19:39 -0700)
commitcf80faee79f98c0608a86e9006af57a99ffad650
tree6d17125b463f634844a5f02773037b96d63dba1b
parent6d82f67e2586cf6b090061ad301ae5f13fa1a0ee
devlink: add function to take snapshot while locked

A future change is going to add a new devlink command to request
a snapshot on demand. This function will want to call the
devlink_region_snapshot_create function while already holding the
devlink instance lock.

Extract the logic of this function into a static function prefixed by
`__` to indicate that it is an internal helper function. Modify the
original function to be implemented in terms of the new locked
function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c