summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2017-06-16 19:48:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-17 09:42:20 -0400
commit133d55cdb2f1f9e258d6dc34594a6c565f10b3fd (patch)
treeba2d42f4b9faaec0ddd8ffad9d5e73923b8ce39a /include/linux/fs.h
parent8a932f73e5b4227bf787474b44dc70b6961d6246 (diff)
block: order /proc/devices by major number
Presently, the order of the block devices listed in /proc/devices is not entirely sequential. If a block device has a major number greater than BLKDEV_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 BLKDEV_MAJOR_MAX as an artificial limit (chosen to be 512). It will then print all devices in major order number from 0 to the maximum. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jeff Layton <jlayton@poochiereds.net> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b07433c335ca..570dcc61fda6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2503,14 +2503,14 @@ static inline void unregister_chrdev(unsigned int major, const char *name)
2503#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ 2503#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */
2504 2504
2505#ifdef CONFIG_BLOCK 2505#ifdef CONFIG_BLOCK
2506#define BLKDEV_MAJOR_HASH_SIZE 255 2506#define BLKDEV_MAJOR_MAX 512
2507extern const char *__bdevname(dev_t, char *buffer); 2507extern const char *__bdevname(dev_t, char *buffer);
2508extern const char *bdevname(struct block_device *bdev, char *buffer); 2508extern const char *bdevname(struct block_device *bdev, char *buffer);
2509extern struct block_device *lookup_bdev(const char *); 2509extern struct block_device *lookup_bdev(const char *);
2510extern void blkdev_show(struct seq_file *,off_t); 2510extern void blkdev_show(struct seq_file *,off_t);
2511 2511
2512#else 2512#else
2513#define BLKDEV_MAJOR_HASH_SIZE 0 2513#define BLKDEV_MAJOR_MAX 0
2514#endif 2514#endif
2515 2515
2516extern void init_special_inode(struct inode *, umode_t, dev_t); 2516extern void init_special_inode(struct inode *, umode_t, dev_t);