diff options
author | Joe Korty <joe.korty@ccur.com> | 2006-03-31 05:30:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:53 -0500 |
commit | 68eef3b4791572ecb70249c7fb145bb3742dd899 (patch) | |
tree | 1f61fce839cec8d672ae06a423d46f0a6fcd924d /include | |
parent | a2c348fe0117adced11e374329a5ea3f7c43cb41 (diff) |
[PATCH] Simplify proc/devices and fix early termination regression
Make baby-simple the code for /proc/devices. Based on the proven design
for /proc/interrupts.
This also fixes the early-termination regression 2.6.16 introduced, as
demonstrated by:
# dd if=/proc/devices bs=1
Character devices:
1 mem
27+0 records in
27+0 records out
This should also work (but is untested) when /proc/devices >4096 bytes,
which I believe is what the original 2.6.16 rewrite fixed.
[akpm@osdl.org: cleanups, simplifications]
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 20fa5f6d7269..20a7afd4590c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1413,6 +1413,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
1413 | #endif | 1413 | #endif |
1414 | 1414 | ||
1415 | /* fs/char_dev.c */ | 1415 | /* fs/char_dev.c */ |
1416 | #define CHRDEV_MAJOR_HASH_SIZE 255 | ||
1416 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1417 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
1417 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1418 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
1418 | extern int register_chrdev(unsigned int, const char *, | 1419 | extern int register_chrdev(unsigned int, const char *, |
@@ -1420,25 +1421,17 @@ extern int register_chrdev(unsigned int, const char *, | |||
1420 | extern int unregister_chrdev(unsigned int, const char *); | 1421 | extern int unregister_chrdev(unsigned int, const char *); |
1421 | extern void unregister_chrdev_region(dev_t, unsigned); | 1422 | extern void unregister_chrdev_region(dev_t, unsigned); |
1422 | extern int chrdev_open(struct inode *, struct file *); | 1423 | extern int chrdev_open(struct inode *, struct file *); |
1423 | extern int get_chrdev_list(char *); | 1424 | extern void chrdev_show(struct seq_file *,off_t); |
1424 | extern void *acquire_chrdev_list(void); | ||
1425 | extern int count_chrdev_list(void); | ||
1426 | extern void *get_next_chrdev(void *); | ||
1427 | extern int get_chrdev_info(void *, int *, char **); | ||
1428 | extern void release_chrdev_list(void *); | ||
1429 | 1425 | ||
1430 | /* fs/block_dev.c */ | 1426 | /* fs/block_dev.c */ |
1427 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
1431 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1428 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1432 | extern const char *__bdevname(dev_t, char *buffer); | 1429 | extern const char *__bdevname(dev_t, char *buffer); |
1433 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1430 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
1434 | extern struct block_device *lookup_bdev(const char *); | 1431 | extern struct block_device *lookup_bdev(const char *); |
1435 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1432 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
1436 | extern void close_bdev_excl(struct block_device *); | 1433 | extern void close_bdev_excl(struct block_device *); |
1437 | extern void *acquire_blkdev_list(void); | 1434 | extern void blkdev_show(struct seq_file *,off_t); |
1438 | extern int count_blkdev_list(void); | ||
1439 | extern void *get_next_blkdev(void *); | ||
1440 | extern int get_blkdev_info(void *, int *, char **); | ||
1441 | extern void release_blkdev_list(void *); | ||
1442 | 1435 | ||
1443 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1436 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
1444 | 1437 | ||