]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-blk: use ida to allocate disk index
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 31 Oct 2011 07:05:36 +0000 (08:05 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 31 Oct 2011 07:05:36 +0000 (08:05 +0100)
commitc5c14f3e75e8f07e5e5fc407f2de85413e9161a3
tree53c4069ef7be8e54e0bce7c82c0f7316f08390e6
parentf273419ce5cf769cfdbf97a210146fc38456f6d4
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: Jens Axboe <axboe@kernel.dk>
drivers/block/virtio_blk.c