]> git.baikalelectronics.ru Git - kernel.git/commit
block/rnbd-srv: Replace sess_dev_list with index_idr
authorMd Haris Iqbal <haris.iqbal@ionos.com>
Thu, 7 Jul 2022 14:31:22 +0000 (16:31 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:14:50 +0000 (17:14 -0600)
commitd43086e391f1a757d0eea84f2b275610f1b42fe9
treeadf52190feed0d436cefe121a081760d02244e77
parent2aff9f9be1fb4d53c4dff28c0f7b4af0bad03200
block/rnbd-srv: Replace sess_dev_list with index_idr

The structure rnbd_srv_session maintains a list and an xarray of
rnbd_srv_dev. There is no need to keep both as one of them can serve the
purpose.

Since one of the places where the lookup of rnbd_srv_dev using
rnbd_srv_session is IO path, an xarray would serve us better than a list
traversal. Hence remove sess_dev_list from rnbd_srv_session, and replace
its uses from xarray.

Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Reviewed-by: Aleksei Marov <aleksei.marov@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20220707143122.460362-3-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-srv.c
drivers/block/rnbd/rnbd-srv.h