summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2017-06-15 16:05:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-17 09:28:50 -0400
commit8a932f73e5b4227bf787474b44dc70b6961d6246 (patch)
treed4aee1018a99bca853584061cb4cc71afecd7266 /include/linux/fs.h
parenta5d31a3f81c6fb13b381951bf6163444c0257e8b (diff)
char_dev: order /proc/devices by major number
Presently, the order of the char devices listed in /proc/devices is not entirely sequential. If a char device has a major number greater than CHRDEV_MAJOR_HASH_SIZE (255), it will be ordered as if its major were module 255. For example, 511 appears after 1. This patch cleans that up and prints each major number in the correct order, regardless of where they are stored in the hash table. In order to do this, we introduce CHRDEV_MAJOR_MAX as an artificial limit (chosen to be 511). It will then print all devices in major order number from 0 to the maximum. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Alan Cox <alan@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1773dcf1e318..b07433c335ca 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2470,7 +2470,7 @@ static inline void bd_unlink_disk_holder(struct block_device *bdev,
2470#endif 2470#endif
2471 2471
2472/* fs/char_dev.c */ 2472/* fs/char_dev.c */
2473#define CHRDEV_MAJOR_HASH_SIZE 255 2473#define CHRDEV_MAJOR_MAX 512
2474/* Marks the bottom of the first segment of free char majors */ 2474/* Marks the bottom of the first segment of free char majors */
2475#define CHRDEV_MAJOR_DYN_END 234 2475#define CHRDEV_MAJOR_DYN_END 234
2476/* Marks the top and bottom of the second segment of free char majors */ 2476/* Marks the top and bottom of the second segment of free char majors */