aboutsummaryrefslogtreecommitdiffstats
path: root/fs/char_dev.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@tglx.tec.linutronix.de>2005-06-26 17:20:36 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-06-26 17:20:36 -0400
commit7ca6448dbfb398bba36eda3c01bc14b86c3675be (patch)
tree82d934ebf07f22a2c64c3b6d82ec24082878b43a /fs/char_dev.c
parentf1f67a9874f1a4bba1adff6d694aa52e5f52ff1a (diff)
parent7d681b23d6cc14a8c026ea6756242cb522cbbcae (diff)
Merge with rsync://fileserver/linux
Update to Linus latest
Diffstat (limited to 'fs/char_dev.c')
-rw-r--r--fs/char_dev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index c1e3537909fc..e82aac9cc2f5 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -56,10 +56,21 @@ int get_chrdev_list(char *page)
56 56
57 down(&chrdevs_lock); 57 down(&chrdevs_lock);
58 for (i = 0; i < ARRAY_SIZE(chrdevs) ; i++) { 58 for (i = 0; i < ARRAY_SIZE(chrdevs) ; i++) {
59 for (cd = chrdevs[i]; cd; cd = cd->next) 59 for (cd = chrdevs[i]; cd; cd = cd->next) {
60 /*
61 * if the current name, plus the 5 extra characters
62 * in the device line for this entry
63 * would run us off the page, we're done
64 */
65 if ((len+strlen(cd->name) + 5) >= PAGE_SIZE)
66 goto page_full;
67
68
60 len += sprintf(page+len, "%3d %s\n", 69 len += sprintf(page+len, "%3d %s\n",
61 cd->major, cd->name); 70 cd->major, cd->name);
71 }
62 } 72 }
73page_full:
63 up(&chrdevs_lock); 74 up(&chrdevs_lock);
64 75
65 return len; 76 return len;