]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/block/virtio_blk.c
virtio_blk: helper function to format disk names
authorRen Mingxin <renmx@cn.fujitsu.com>
Tue, 10 Apr 2012 07:28:05 +0000 (15:28 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 12 Apr 2012 07:37:05 +0000 (10:37 +0300)
commitc0aa3e0916d7e531e69b02e426f7162dfb1c6c0f
tree08968a635c4d43fb16c071cbcdbe25b302b85924
parent5e7045b010bdb56abbfe5714e8debf03a024c016
virtio_blk: helper function to format disk names

The current virtio block's naming algorithm just supports 18278
(26^3 + 26^2 + 26) disks. If there are more virtio blocks,
there will be disks with the same name.

Based on commit 3e1a7ff8a0a7b948f2684930166954f9e8e776fe, add
a function "virtblk_name_format()" for virtio block to support mass
of disks naming.

Notes:
- Our naming scheme is ugly. We are stuck with it
  for virtio but don't use it for any new driver:
  new drivers should name their devices PREFIX%d
  where the sequence number can be allocated by ida
- sd_format_disk_name has exactly the same logic.
  Moving it to a central place was deferred over worries
  that this will make people keep using the legacy naming
  in new drivers.
  We kept code idential in case someone wants to deduplicate later.

Signed-off-by: Ren Mingxin <renmx@cn.fujitsu.com>
Acked-by: Asias He <asias@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/block/virtio_blk.c