|
From: <vl...@us...> - 2012-10-04 22:18:07
|
Revision: 4548
http://scst.svn.sourceforge.net/scst/?rev=4548&view=rev
Author: vlnb
Date: 2012-10-04 22:18:01 +0000 (Thu, 04 Oct 2012)
Log Message:
-----------
Cleanup
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-10-04 22:08:02 UTC (rev 4547)
+++ trunk/scst/src/scst_targ.c 2012-10-04 22:18:01 UTC (rev 4548)
@@ -2687,6 +2687,19 @@
goto out;
}
+typedef int (*scst_local_exec_fn)(struct scst_cmd *cmd);
+
+static scst_local_exec_fn scst_local_fns[256] = {
+ [RESERVE] = scst_reserve_local,
+ [RESERVE_10] = scst_reserve_local,
+ [RELEASE] = scst_release_local,
+ [RELEASE_10] = scst_release_local,
+ [PERSISTENT_RESERVE_IN] = scst_persistent_reserve_in_local,
+ [PERSISTENT_RESERVE_OUT] = scst_persistent_reserve_out_local,
+ [REPORT_LUNS] = scst_report_luns_local,
+ [REQUEST_SENSE] = scst_request_sense_local,
+};
+
static int scst_do_local_exec(struct scst_cmd *cmd)
{
int res;
@@ -2711,31 +2724,7 @@
goto out;
}
- switch (cmd->cdb[0]) {
- case RESERVE:
- case RESERVE_10:
- res = scst_reserve_local(cmd);
- break;
- case RELEASE:
- case RELEASE_10:
- res = scst_release_local(cmd);
- break;
- case PERSISTENT_RESERVE_IN:
- res = scst_persistent_reserve_in_local(cmd);
- break;
- case PERSISTENT_RESERVE_OUT:
- res = scst_persistent_reserve_out_local(cmd);
- break;
- case REPORT_LUNS:
- res = scst_report_luns_local(cmd);
- break;
- case REQUEST_SENSE:
- res = scst_request_sense_local(cmd);
- break;
- default:
- res = SCST_EXEC_NOT_COMPLETED;
- break;
- }
+ res = scst_local_fns[cmd->cdb[0]](cmd);
out:
TRACE_EXIT_RES(res);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|