linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* block: how shall register_blkdev() work?
@ 2009-01-11 11:43 Németh Márton
  0 siblings, 0 replies; only message in thread
From: Németh Márton @ 2009-01-11 11:43 UTC (permalink / raw)
  To: Jens Axboe, linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-11 11:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-11 11:43 block: how shall register_blkdev() work? Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).