Re: [PATCH 3/5] virtio-scsi: allocate target pointers in a separate memory block

2012-08-28 Thread Paolo Bonzini
Il 28/08/2012 16:07, Sasha Levin ha scritto: >> > - num_targets = sh->max_id; >> > - for (i = 0; i < num_targets; i++) { >> > - kfree(vscsi->tgt[i]); >> > - vscsi->tgt[i] = NULL; >> > + if (vscsi->tgt) { >> > + num_targets = sh->max_id; >> > + for (i = 0; i <

Re: [PATCH 3/5] virtio-scsi: allocate target pointers in a separate memory block

2012-08-28 Thread Sasha Levin
On 08/28/2012 01:54 PM, Paolo Bonzini wrote: > We will place the request virtqueues in the flexible array member. > > Refining the virtqueue API would let us drop the sglist copy, at > which point the pointer-to-array-of-pointers can become a simple > pointer-to-array. It would both simplify the

[PATCH 3/5] virtio-scsi: allocate target pointers in a separate memory block

2012-08-28 Thread Paolo Bonzini
We will place the request virtqueues in the flexible array member. Refining the virtqueue API would let us drop the sglist copy, at which point the pointer-to-array-of-pointers can become a simple pointer-to-array. It would both simplify the allocation and remove a dereference in several hot path