]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: extract snapshot id allocation to helper function
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 26 Mar 2020 18:37:13 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 02:39:26 +0000 (19:39 -0700)
commitab4dc663887fbcd1ecf42d8ee42cc6e6ec4042db
treee2283eeececd884174542f5d5bbe123d813a7088
parentba282f466d169ff2077340e6d3cc3486de5fca7d
devlink: extract snapshot id allocation to helper function

A future change is going to implement a new devlink command to request
a snapshot on demand. As part of this, the logic for handling the
snapshot ids will be refactored. To simplify the snapshot id allocation
function, move it to a separate function prefixed by `__`. This helper
function will assume the lock is held.

While no other callers will exist, it simplifies refactoring the logic
because there is no need to complicate the function with gotos to handle
unlocking on failure.

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