File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ static const char *_name = DM_NAME;
3737static unsigned int major = 0 ;
3838static unsigned int _major = 0 ;
3939
40+ static DEFINE_IDR (_minor_idr );
41+
4042static DEFINE_SPINLOCK (_minor_lock );
4143/*
4244 * For bio-based dm.
@@ -313,6 +315,12 @@ static void __exit dm_exit(void)
313315
314316 while (i -- )
315317 _exits [i ]();
318+
319+ /*
320+ * Should be empty by this point.
321+ */
322+ idr_remove_all (& _minor_idr );
323+ idr_destroy (& _minor_idr );
316324}
317325
318326/*
@@ -1705,8 +1713,6 @@ static int dm_any_congested(void *congested_data, int bdi_bits)
17051713/*-----------------------------------------------------------------
17061714 * An IDR is used to keep track of allocated minor numbers.
17071715 *---------------------------------------------------------------*/
1708- static DEFINE_IDR (_minor_idr );
1709-
17101716static void free_minor (int minor )
17111717{
17121718 spin_lock (& _minor_lock );
You can’t perform that action at this time.
0 commit comments