2004-06-01 14:03:57

by Paul Clements

[permalink] [raw]
Subject: [PATCH] nbd: fix device names

--- linux/drivers/block/nbd.c.PRISTINE Thu Apr 15 13:40:18 2004
+++ linux/drivers/block/nbd.c Thu Apr 15 13:53:18 2004
@@ -713,7 +753,7 @@ static int __init nbd_init(void)
disk->fops = &nbd_fops;
disk->private_data = &nbd_dev[i];
disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
- sprintf(disk->disk_name, "nbd%d", i);
+ sprintf(disk->disk_name, "nb%d", i);
sprintf(disk->devfs_name, "nbd/%d", i);
set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */
add_disk(disk);


Attachments:
nbd_nb_devname.diff (497.00 B)

2004-06-01 23:29:52

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] nbd: fix device names

Paul Clements <[email protected]> wrote:
>
> It seems more appropriate to call the devices "nbX" rather than "nbdX",
> since that's what the device nodes are actually named.

This affects /proc/partitions, /proc/diskstats, and probably other things.
I think it's too late to change it.

2004-06-02 03:08:16

by Paul Clements

[permalink] [raw]
Subject: Re: [PATCH] nbd: fix device names

Andrew Morton wrote:
> Paul Clements <[email protected]> wrote:
>
>>It seems more appropriate to call the devices "nbX" rather than "nbdX",
>>since that's what the device nodes are actually named.
>
>
> This affects /proc/partitions, /proc/diskstats, and probably other things.

Network block devices don't actually show up in /proc/partitions, but
you have a valid point that the other uses would change. Although, I
think it's a change for the better.

> I think it's too late to change it.

Fair enough. I can live with this discrepancy, although I think nbd is
the only block device driver that has this problem. That's the only
reason I sent the patch along...just trying to make nbd consistent with
all the other device drivers.

Thanks,
Paul

2004-06-03 13:45:49

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] nbd: fix device names

Hi!

> It seems more appropriate to call the devices "nbX" rather than
> "nbdX",
> since that's what the device nodes are actually named.

> @@ -713,7 +753,7 @@ static int __init nbd_init(void)
> disk->fops = &nbd_fops;
> disk->private_data = &nbd_dev[i];
> disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
> - sprintf(disk->disk_name, "nbd%d", i);
> + sprintf(disk->disk_name, "nb%d", i);
> sprintf(disk->devfs_name, "nbd/%d", i);

You might want to fix devfs name, too.


--
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms