lkml.org 
[lkml]   [2003]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] a better bdevname
With the recent devfs surgery disk_name has become useable
in all contexts (it doesn't do anything but copying a string anymore),
so we can use it in all contexts.

Switch over bdevname to use it instead of going through the major
list.


--- 1.106/fs/partitions/check.c Sun Apr 20 17:52:10 2003
+++ edited/fs/partitions/check.c Fri Apr 25 22:32:45 2003
@@ -118,6 +118,12 @@
return buf;
}

+const char *bdevname(struct block_device *bdev, char *buf)
+{
+ int part = MINOR(bdev->bd_dev) - bdev->bd_disk->first_minor;
+ return disk_name(bdev->bd_disk, part, buf);
+}
+
static struct parsed_partitions *
check_partition(struct gendisk *hd, struct block_device *bdev)
{
--- 1.233/include/linux/fs.h Thu Apr 24 06:30:41 2003
+++ edited/include/linux/fs.h Fri Apr 25 22:29:53 2003
@@ -1067,10 +1067,7 @@
/* fs/block_dev.c */
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
extern const char *__bdevname(dev_t, char *buffer);
-extern inline const char *bdevname(struct block_device *bdev, char *buffer)
-{
- return __bdevname(bdev->bd_dev, buffer);
-}
+extern const char *bdevname(struct block_device *bdev, char *buffer);
extern struct block_device *lookup_bdev(const char *);
extern struct block_device *open_bdev_excl(const char *, int, int, void *);
extern void close_bdev_excl(struct block_device *, int);
--- 1.190/kernel/ksyms.c Thu Apr 24 06:30:41 2003
+++ edited/kernel/ksyms.c Fri Apr 25 22:32:56 2003
@@ -512,6 +512,7 @@
EXPORT_SYMBOL(vsnprintf);
EXPORT_SYMBOL(vsscanf);
EXPORT_SYMBOL(__bdevname);
+EXPORT_SYMBOL(bdevname);
EXPORT_SYMBOL(cdevname);
EXPORT_SYMBOL(simple_strtoull);
EXPORT_SYMBOL(simple_strtoul);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.091 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site