Tomonori, Mike, could you comment on that, please?
Yes, but we on the target side would not be able to implement the ABI compatible interface without using library functions provided by those C files. Or, at least, it would be much harder.
So, would it be OK for you to keep those files?
I mean that if we keep those 2 files to ease our ABI compatibility effort, it would effectively mean that we would leave STGT merged. It isn't something we would create, it just would be so itself as a matter of fact. Ultimately, STGT is an user space engine. What it has in the kernel is the interface helper functions to interact with the in-kernel drivers. The simplest way to achieve the ABI compatibility is to make a backend module acting as an STGT in-target driver.
(Actually, I may not ask it, because this is the way how LIO seems[1] implemented that, which was approved on the LSF summit. I only want to make all pros and cons clear from the very beginning.)
Thanks,
Vlad
1. I wrote "seems", because currently LIO has the following code for STGT commands execution:
int stgt_do_task(se_task_t *task)
{
stgt_plugin_task_t *st = (stgt_plugin_task_t *) task->transport_req;
struct Scsi_Host *sh = task->se_dev->se_hba->hba_ptr;
struct scsi_cmnd *sc;
int tag = MSG_SIMPLE_TAG;
sc = scsi_host_get_command(sh, st->stgt_direction, GFP_KERNEL);
if (!sc) {
printk(KERN_ERR "Unable to allocate memory for struct"
" scsi_cmnd\n");
return PYX_TRANSPORT_LU_COMM_FAILURE;
}
memcpy(sc->cmnd, st->stgt_cdb, MAX_COMMAND_SIZE);
sc->sdb.length = task->task_size;
sc->sdb.table.sgl = task->task_sg;
sc->tag = tag;
BUG();
#warning FIXME: Get struct scsi_lun for scsi_tgt_queue_command()
#if 0
err = scsi_tgt_queue_command(sc, itn_id, (struct scsi_lun *)&cmd->lun,
cmd->tag);
if (err) {
printk(KERN_INFO "scsi_tgt_queue_command() failed for sc:"
" %p\n", sc);
scsi_host_put_command(sh, sc);
}
#endif
return PYX_TRANSPORT_SENT_TO_TRANSPORT;
}
which means that this pluging completely not functioning.
--