public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: any value in /proc/devices showing baseminor and minorct?
Date: Wed, 23 Dec 2009 06:23:41 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912230619430.17589@localhost> (raw)


  once upon a time, i tweaked fs/char_dev.c so that /proc/devices
would display not only the major number and device name, but the
baseminor and minorct values as well, thusly:

=====

diff --git a/fs/char_dev.c b/fs/char_dev.c
index a173551..57022d1 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -70,7 +70,8 @@ void chrdev_show(struct seq_file *f, off_t offset)
 	if (offset < CHRDEV_MAJOR_HASH_SIZE) {
 		mutex_lock(&chrdevs_lock);
 		for (cd = chrdevs[offset]; cd; cd = cd->next)
-			seq_printf(f, "%3d %s\n", cd->major, cd->name);
+			seq_printf(f, "%3d %s [%d, %d]\n", cd->major, cd->name,
+				cd->baseminor, cd->minorct);
 		mutex_unlock(&chrdevs_lock);
 	}
 }

=====

  is there any value in an enhancement like that?  i dreamed it up
based on one of the early examples from LDD3, where one has to use
"mknod" in user space to create the appropriate dev files based on the
kernel-space registration.  the major number is accessible, of course,
but the minor numbers were simply *assumed* to be 0->3.

  would printing out that extra info have any value?  or even making
it user-configurable?  or perhaps part of a debugging setting?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

                 reply	other threads:[~2009-12-23 11:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0912230619430.17589@localhost \
    --to=rpjday@crashcourse.ca \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox