diff options
author | Christoph Hellwig <hch@lst.de> | 2021-08-11 14:44:27 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-13 22:17:39 +0200 |
commit | 6177b56c96ff3b5e23d47f6b6c8630f31145da93 (patch) | |
tree | 37aa161a899ba695984ca13a3fc8d4ec0cc8382e /drivers/greybus | |
parent | nbd: return the allocated nbd_device from nbd_dev_add (diff) | |
download | linux-6177b56c96ff3b5e23d47f6b6c8630f31145da93.tar.xz linux-6177b56c96ff3b5e23d47f6b6c8630f31145da93.zip |
nbd: refactor device search and allocation in nbd_genl_connect
Use idr_for_each_entry instead of the awkward callback to find an
existing device for the index == -1 case, and de-duplicate the device
allocation if no existing device was found.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210811124428.2368491-6-hch@lst.de
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/greybus')
0 files changed, 0 insertions, 0 deletions