Skip to content

Commit c4b2b7d

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove CONFIG_DEBUG_BLOCK_EXT_DEVT
This might have been a neat debug aid when the extended dev_t was added, but that time is long gone. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 539711d commit c4b2b7d

File tree

5 files changed

+4
-72
lines changed

5 files changed

+4
-72
lines changed

arch/riscv/configs/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ CONFIG_DEBUG_PLIST=y
132132
CONFIG_DEBUG_SG=y
133133
# CONFIG_RCU_TRACE is not set
134134
CONFIG_RCU_EQS_DEBUG=y
135-
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
136135
# CONFIG_FTRACE is not set
137136
# CONFIG_RUNTIME_TESTING_MENU is not set
138137
CONFIG_MEMTEST=y

arch/riscv/configs/rv32_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ CONFIG_DEBUG_PLIST=y
127127
CONFIG_DEBUG_SG=y
128128
# CONFIG_RCU_TRACE is not set
129129
CONFIG_RCU_EQS_DEBUG=y
130-
CONFIG_DEBUG_BLOCK_EXT_DEVT=y
131130
# CONFIG_FTRACE is not set
132131
# CONFIG_RUNTIME_TESTING_MENU is not set
133132
CONFIG_MEMTEST=y

block/genhd.c

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -313,54 +313,19 @@ void unregister_blkdev(unsigned int major, const char *name)
313313

314314
EXPORT_SYMBOL(unregister_blkdev);
315315

316-
/**
317-
* blk_mangle_minor - scatter minor numbers apart
318-
* @minor: minor number to mangle
319-
*
320-
* Scatter consecutively allocated @minor number apart if MANGLE_DEVT
321-
* is enabled. Mangling twice gives the original value.
322-
*
323-
* RETURNS:
324-
* Mangled value.
325-
*
326-
* CONTEXT:
327-
* Don't care.
328-
*/
329-
static int blk_mangle_minor(int minor)
330-
{
331-
#ifdef CONFIG_DEBUG_BLOCK_EXT_DEVT
332-
int i;
333-
334-
for (i = 0; i < MINORBITS / 2; i++) {
335-
int low = minor & (1 << i);
336-
int high = minor & (1 << (MINORBITS - 1 - i));
337-
int distance = MINORBITS - 1 - 2 * i;
338-
339-
minor ^= low | high; /* clear both bits */
340-
low <<= distance; /* swap the positions */
341-
high >>= distance;
342-
minor |= low | high; /* and set */
343-
}
344-
#endif
345-
return minor;
346-
}
347-
348316
int blk_alloc_ext_minor(void)
349317
{
350318
int idx;
351319

352320
idx = ida_alloc_range(&ext_devt_ida, 0, NR_EXT_DEVT, GFP_KERNEL);
353-
if (idx < 0) {
354-
if (idx == -ENOSPC)
355-
return -EBUSY;
356-
return idx;
357-
}
358-
return blk_mangle_minor(idx);
321+
if (idx == -ENOSPC)
322+
return -EBUSY;
323+
return idx;
359324
}
360325

361326
void blk_free_ext_minor(unsigned int minor)
362327
{
363-
ida_free(&ext_devt_ida, blk_mangle_minor(minor));
328+
ida_free(&ext_devt_ida, minor);
364329
}
365330

366331
static char *bdevt_str(dev_t devt, char *buf)

init/do_mounts.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,6 @@ void __init mount_block_root(char *name, int flags)
432432
printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
433433

434434
printk_all_partitions();
435-
#ifdef CONFIG_DEBUG_BLOCK_EXT_DEVT
436-
printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify "
437-
"explicit textual name for \"root=\" boot option.\n");
438-
#endif
439435
panic("VFS: Unable to mount root fs on %s", b);
440436
}
441437
if (!(flags & SB_RDONLY)) {

lib/Kconfig.debug

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,33 +1679,6 @@ config DEBUG_WQ_FORCE_RR_CPU
16791679
feature by default. When enabled, memory and cache locality will
16801680
be impacted.
16811681

1682-
config DEBUG_BLOCK_EXT_DEVT
1683-
bool "Force extended block device numbers and spread them"
1684-
depends on DEBUG_KERNEL
1685-
depends on BLOCK
1686-
default n
1687-
help
1688-
BIG FAT WARNING: ENABLING THIS OPTION MIGHT BREAK BOOTING ON
1689-
SOME DISTRIBUTIONS. DO NOT ENABLE THIS UNLESS YOU KNOW WHAT
1690-
YOU ARE DOING. Distros, please enable this and fix whatever
1691-
is broken.
1692-
1693-
Conventionally, block device numbers are allocated from
1694-
predetermined contiguous area. However, extended block area
1695-
may introduce non-contiguous block device numbers. This
1696-
option forces most block device numbers to be allocated from
1697-
the extended space and spreads them to discover kernel or
1698-
userland code paths which assume predetermined contiguous
1699-
device number allocation.
1700-
1701-
Note that turning on this debug option shuffles all the
1702-
device numbers for all IDE and SCSI devices including libata
1703-
ones, so root partition specified using device number
1704-
directly (via rdev or root=MAJ:MIN) won't work anymore.
1705-
Textual device names (root=/dev/sdXn) will continue to work.
1706-
1707-
Say N if you are unsure.
1708-
17091682
config CPU_HOTPLUG_STATE_CONTROL
17101683
bool "Enable CPU hotplug state control"
17111684
depends on DEBUG_KERNEL

0 commit comments

Comments
 (0)