iscsi-dd can be used to copy the content of one iscsi lun onto a different iscsi lun of the exact same sixe. This example illustrates how to "steal" a task structure from a callback so we can use store it and have it remains valid after the read10 callback has completed. It also illustrates the async api of libiscsi for read10/write10. Initially a number of read10 calls are made asynchronously until the queue is full. As each read10 completes and returns data, we issue a write10 to write that data to the other lun. As soon as a write10 completes, we "release" the initial read10 task corresponding to what we wrote and issue a new read10 to continue copying the next set of un-read data. Using the async api, it should be easy to get very high performance and throughput even from one single thread.
8.4 KiB
8.4 KiB