Loading lib/idr.c +17 −18 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) { int rv; rv = idr_get_new_above_int(idp, ptr, starting_id); /* * This is a cheap hack until the IDR code can be fixed to Loading Loading @@ -259,6 +260,7 @@ EXPORT_SYMBOL(idr_get_new_above); int idr_get_new(struct idr *idp, void *ptr, int *id) { int rv; rv = idr_get_new_above_int(idp, ptr, 0); /* * This is a cheap hack until the IDR code can be fixed to Loading Loading @@ -308,10 +310,9 @@ static void sub_remove(struct idr *idp, int shift, int id) } if (!*paa) idp->layers = 0; } else { } else idr_remove_warning(id); } } /** * idr_remove - remove the given id and free it's slot Loading @@ -326,8 +327,7 @@ void idr_remove(struct idr *idp, int id) id &= MAX_ID_MASK; sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); if ( idp->top && idp->top->count == 1 && (idp->layers > 1) && if (idp->top && idp->top->count == 1 && (idp->layers > 1) && idp->top->ary[0]) { // We can drop a layer p = idp->top->ary[0]; Loading @@ -337,7 +337,6 @@ void idr_remove(struct idr *idp, int id) --idp->layers; } while (idp->id_free_cnt >= IDR_FREE_MAX) { p = alloc_layer(idp); kmem_cache_free(idr_layer_cache, p); return; Loading Loading @@ -391,8 +390,8 @@ void *idr_find(struct idr *idp, int id) } EXPORT_SYMBOL(idr_find); static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache, unsigned long flags) static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache, unsigned long flags) { memset(idr_layer, 0, sizeof(struct idr_layer)); } Loading Loading
lib/idr.c +17 −18 Original line number Diff line number Diff line Loading @@ -225,6 +225,7 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id) int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) { int rv; rv = idr_get_new_above_int(idp, ptr, starting_id); /* * This is a cheap hack until the IDR code can be fixed to Loading Loading @@ -259,6 +260,7 @@ EXPORT_SYMBOL(idr_get_new_above); int idr_get_new(struct idr *idp, void *ptr, int *id) { int rv; rv = idr_get_new_above_int(idp, ptr, 0); /* * This is a cheap hack until the IDR code can be fixed to Loading Loading @@ -308,10 +310,9 @@ static void sub_remove(struct idr *idp, int shift, int id) } if (!*paa) idp->layers = 0; } else { } else idr_remove_warning(id); } } /** * idr_remove - remove the given id and free it's slot Loading @@ -326,8 +327,7 @@ void idr_remove(struct idr *idp, int id) id &= MAX_ID_MASK; sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); if ( idp->top && idp->top->count == 1 && (idp->layers > 1) && if (idp->top && idp->top->count == 1 && (idp->layers > 1) && idp->top->ary[0]) { // We can drop a layer p = idp->top->ary[0]; Loading @@ -337,7 +337,6 @@ void idr_remove(struct idr *idp, int id) --idp->layers; } while (idp->id_free_cnt >= IDR_FREE_MAX) { p = alloc_layer(idp); kmem_cache_free(idr_layer_cache, p); return; Loading Loading @@ -391,8 +390,8 @@ void *idr_find(struct idr *idp, int id) } EXPORT_SYMBOL(idr_find); static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache, unsigned long flags) static void idr_cache_ctor(void * idr_layer, kmem_cache_t *idr_layer_cache, unsigned long flags) { memset(idr_layer, 0, sizeof(struct idr_layer)); } Loading