]> 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)
commitce11bdf946176d48c2c0d36b56f0bf368c177298
treeadf52190feed0d436cefe121a081760d02244e77
parent4bc14f3101364877dd59085f39e068a2a7ec9f2d
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