block: how shall register_blkdev() work?

From: NÃmeth MÃrton
Date: Sun Jan 11 2009 - 06:43:50 EST


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@xxxxxxxxxxx>

--- 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/