From: Christoph Hellwig <hch@lst.de>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] a better bdevname
Date: Sat, 26 Apr 2003 00:52:46 +0200 [thread overview]
Message-ID: <20030426005246.A11834@lst.de> (raw)
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);
reply other threads:[~2003-04-25 22:40 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=20030426005246.A11834@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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;
as well as URLs for NNTP newsgroup(s).