]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-blk: use ida to allocate disk index
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 30 Oct 2011 19:29:59 +0000 (21:29 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Nov 2011 01:11:02 +0000 (11:41 +1030)
commit3282d5b48a2c24d6272363c6b3ffed7acb00a107
treeb0a0f017fbeeef3b6be8604f6e40b54ce1053bac
parent098606870fbd73fad322de9de6c356d4d6919137
virtio-blk: use ida to allocate disk index

Based on a patch by Mark Wu <dwu@redhat.com>

Current index allocation in virtio-blk is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while.  It also could cause confusion about the disk
name in the case of hot-plugging disks.
Change virtio-blk to use ida to allocate index, instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/block/virtio_blk.c