On 06/21/2017 04:33 PM, Mike Christie wrote: > In the next patches we will add tcmu netlink support that allows > userspace to send commands to target_core_user. To execute operations > on a se_device/tcmu_dev we need to be able to look up a dev by any old > id. This patch replaces the se_device->dev_index with a idr created > id. > > The next patches will also remove the g_device_list and replace it with > the idr. > > Signed-off-by: Mike Christie <mchristi@xxxxxxxxxx> > --- > > Changes: > - Drop target_init_device_idr/target_destroy_device_idr and use DEFINE_IDR. > > drivers/target/target_core_device.c | 30 ++++++++++++++++++++++++++---- > include/target/target_core_base.h | 1 - > 2 files changed, 26 insertions(+), 5 deletions(-) > > diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c > index 16a701f..d6fc8c0 100644 > --- a/drivers/target/target_core_device.c > +++ b/drivers/target/target_core_device.c > @@ -51,6 +51,7 @@ > > DEFINE_MUTEX(g_device_mutex); > LIST_HEAD(g_device_list); > +DEFINE_IDR(devices_idr); > Nick and Bart, Shoot. I posted the wrong version. That was supposed to be static DEFINE_IDR(devices_idr); That then breaks some other patches down the line. I will resend. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html