public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Subject: block: how shall register_blkdev() work?
Date: Sun, 11 Jan 2009 12:43:33 +0100	[thread overview]
Message-ID: <4969DB65.3090309@freemail.hu> (raw)

Hi,

I started to write some testcases for register_blkdev(), see
http://sourceforge.net/mailarchive/forum.php?thread_name=4969BE28.2030303%40freemail.hu&forum_name=ltp-list .

I am not sure how register_blkdev() should work, so I tried to
write down what I could find out so far, but there are still some open
questions.

Could you please review and correct the following description?

Signed-off-by: Márton Németh <nm127@freemail.hu>

--- linux-2.6.28/block/genhd.c.orig	2008-12-25 00:26:37.000000000 +0100
+++ linux-2.6.28/block/genhd.c	2009-01-11 12:27:02.000000000 +0100
@@ -244,6 +244,24 @@ void blkdev_show(struct seq_file *seqf,
 }
 #endif /* CONFIG_PROC_FS */

+/**
+ * register_blkdev - register a new block device
+ *
+ * @major: [in] the requested major device number [1..255]. If
+ *         @major=0, try to allocate any unused major number.
+ * @name: [in] the name of the new block device
+ *
+ * ??? The @name must be unique within the system. ???
+ * OR: ??? You can use any zero terminated @name string. Note, however, if
+ *         you use a name which is already used it might mask the previous
+ *         device. ???
+ *
+ * Returns the allocated major number [1..255] or the return value is
+ * a negative error code if the wanted @major number is not available
+ * or there is no more major nubmers available when @major=0.
+ *
+ * ??? What does the return value 0 mean?
+ */
 int register_blkdev(unsigned int major, const char *name)
 {
 	struct blk_major_name **n, *p;



Regards,

	Márton Németh

                 reply	other threads:[~2009-01-11 11:43 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=4969DB65.3090309@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=axboe@kernel.dk \
    --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