]> git.karo-electronics.de Git - karo-tx-linux.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)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 1 Nov 2011 23:04:29 +0000 (10:04 +1100)
commitf11e6007ef0cbabf907ff172ca1a81c0bb9f189d
tree138b1d2efbce9e5baad4493895e86fbfb1e1b55a
parent3c36e306eb471e539f5ee1201b70374e2a5499ef
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