[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110615081642.2237.53583.stgit@ltc233.sdl.hitachi.co.jp>
Date: Wed, 15 Jun 2011 17:16:42 +0900
From: Nao Nishijima <nao.nishijima.xt@...achi.com>
To: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: James.Bottomley@...senPartnership.com, greg@...ah.com,
kay.sievers@...y.org, jcm@...hat.com, hare@...e.de,
stefanr@...6.in-berlin.de, yrl.pp-manager.tt@...achi.com,
Nao Nishijima <nao.nishijima.xt@...achi.com>
Subject: [PATCH 3/3] [RFC] fs: print preferred name in procfs messages
Make disk_name() return preferred name instead of disk_name
when preferred name is set. disk_name() is used in
/proc/{partitions, diskstats}. Therefore, those files show
preferred name.
Suggested-by: James Bottomley <James.Bottomley@...senPartnership.com>
Signed-off-by: Nao Nishijima <nao.nishijima.xt@...achi.com>
---
fs/partitions/check.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index d545e97..4ffdcf4 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -125,11 +125,13 @@ static int (*check_part[])(struct parsed_partitions *) = {
char *disk_name(struct gendisk *hd, int partno, char *buf)
{
if (!partno)
- snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
+ snprintf(buf, BDEVNAME_SIZE, "%s", dev_name(disk_to_dev(hd)));
else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))
- snprintf(buf, BDEVNAME_SIZE, "%sp%d", hd->disk_name, partno);
+ snprintf(buf, BDEVNAME_SIZE, "%sp%d", dev_name(disk_to_dev(hd)),
+ partno);
else
- snprintf(buf, BDEVNAME_SIZE, "%s%d", hd->disk_name, partno);
+ snprintf(buf, BDEVNAME_SIZE, "%s%d", dev_name(disk_to_dev(hd)),
+ partno);
return buf;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists