Re: [PATCH 4/5] target/user: Refactor data ring allocation code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/22/2015 03:15 AM, Ilias Tsitsimpis wrote:
Introduce map_cmd_ring()/unmap_cmd_ring() functions that
allocate/deallocate space from the command ring and copy data from/to a
given scatter-gather list. These functions are needed so the next patch,
introducing support for bidirectional commands in TCMU, can use the same
code path both for 't_data_sg' and for 't_bidi_data_sg'.

Signed-off-by: Ilias Tsitsimpis <iliastsi@xxxxxxxxxxx>
Signed-off-by: Vangelis Koukis <vkoukis@xxxxxxxxxxx>

The function names "{map,unmap}_cmd_ring" seem a little off. We might get away with it but I think at some point we're going to want to do some actual mapping of pages to the data area and don't want to be confusing.

First, cmd_ring should really be data_area.

But also, "map" is really allocating space in the data area and possibly copying into it, and "unmap" is possibly copying out of it and then freeing data area space. Calling them copy_{to,from}_data_area also isn't really accurate. I can't think of any good opposing verbs for these function names.

How would things work out if we broke things up so we had a pair of functions to allocate/free data area space, and another pair to copy to/from, between the (possibly discontiguous) data_area and the sg?

Regards -- Andy

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux