mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 15:01:44 +00:00
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>
This commit is contained in:
parent
8a932f73e5
commit
133d55cdb2
3 changed files with 17 additions and 9 deletions
|
@ -2503,14 +2503,14 @@ static inline void unregister_chrdev(unsigned int major, const char *name)
|
|||
#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */
|
||||
|
||||
#ifdef CONFIG_BLOCK
|
||||
#define BLKDEV_MAJOR_HASH_SIZE 255
|
||||
#define BLKDEV_MAJOR_MAX 512
|
||||
extern const char *__bdevname(dev_t, char *buffer);
|
||||
extern const char *bdevname(struct block_device *bdev, char *buffer);
|
||||
extern struct block_device *lookup_bdev(const char *);
|
||||
extern void blkdev_show(struct seq_file *,off_t);
|
||||
|
||||
#else
|
||||
#define BLKDEV_MAJOR_HASH_SIZE 0
|
||||
#define BLKDEV_MAJOR_MAX 0
|
||||
#endif
|
||||
|
||||
extern void init_special_inode(struct inode *, umode_t, dev_t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue