mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
- Kernel patches were renamed (in this commit only deleted)
- VDISK_ONLY was removed, SCSI_EXEC_REQ_FIFO_DEFINED, defined by corresponding kernel patch used instead - Minor fixes - Docs updates All users will need to revert old SCST kernel patch and apply the corresponding new one. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@142 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+30
-18
@@ -22,7 +22,7 @@ SCST supports the following I/O modes:
|
||||
devices as virtual remotely available SCSI disks or CDROMs with
|
||||
benefits of the Linux page cache
|
||||
|
||||
* BLOCKIO mode, which performsd irect block IO with a block device,
|
||||
* BLOCKIO mode, which performs direct block IO with a block device,
|
||||
bypassing page-cache for all operations. This mode works ideally with
|
||||
high-end storage HBAs and for applications that either do not need
|
||||
caching between application and disk or need the large block
|
||||
@@ -53,11 +53,11 @@ points to the source code for your currently running kernel.
|
||||
Then, since in the mainstream kernels scsi_do_req()/scsi_execute_async()
|
||||
work in LIFO order, instead of expected and required FIFO, SCST needs a
|
||||
new functions scsi_do_req_fifo()/scsi_execute_async_fifo() to be added
|
||||
in the kernel. Patch 26_scst-2.6.X.patch from "kernel" directory does
|
||||
that. If it doesn't apply to your kernel, apply it manually, it only
|
||||
adds one of those functions and nothing more. You may not patch the
|
||||
kernel if STRICT_SERIALIZING or VDISK_ONLY are defined during the
|
||||
compilation (see their description below).
|
||||
in the kernel. Patch scst_exec_req_fifo.patch from "kernel" directory
|
||||
does that. If it doesn't apply to your kernel, apply it manually, it
|
||||
only adds one of those functions and nothing more. You may not patch the
|
||||
kernel if you don't need pass-through support or STRICT_SERIALIZING is
|
||||
defined during the compilation (see description below).
|
||||
|
||||
To compile SCST type 'make'. It will build SCST itself and its device
|
||||
handlers. To install them type 'make install'. The driver modules will
|
||||
@@ -161,11 +161,6 @@ Compilation options
|
||||
There are the following compilation options, that could be commented
|
||||
in/out in Makefile:
|
||||
|
||||
- VDISK_ONLY - if defined, the pass-through device handlers
|
||||
(scst_disk, scst_tape) will not work, but SCST will not require the
|
||||
kernel patching. Defined by default to ease new people try SCST on
|
||||
their kernels.
|
||||
|
||||
- DEBUG - turns on some debugging code, including some logging. Makes
|
||||
the driver considerably bigger and slower, producing large amount of
|
||||
log data.
|
||||
@@ -196,17 +191,34 @@ in/out in Makefile:
|
||||
patching is necessary.
|
||||
|
||||
- SCST_HIGHMEM - if defined on HIGHMEM systems with 2.6 kernels, it
|
||||
allows SCST to use HIGHMEM. This is very experimental feature and it
|
||||
is unclear, if it brings something valuable, except some performance
|
||||
hit, so in the current version it is disabled. Note, that
|
||||
allows SCST to use HIGHMEM. This is very experimental feature, which
|
||||
is currently broken and unsupported, since it is unclear, if it
|
||||
brings something valuable, except some performance hit. Note, that
|
||||
SCST_HIGHMEM isn't required for HIGHMEM systems and SCST will work
|
||||
fine on them with SCST_HIGHMEM off. Untested.
|
||||
fine on them with SCST_HIGHMEM off.
|
||||
|
||||
- SCST_STRICT_SECURITY - if defined, makes SCST clean allocated data
|
||||
- SCST_STRICT_SECURITY - if defined, makes SCST zero allocated data
|
||||
buffers. Undefining it (default) considerably improves performance
|
||||
and eases CPU load, but could create a security hole (information
|
||||
leakage), so enable it, if you have strict security requirements.
|
||||
|
||||
HIGHMEM kernel configurations are fully supported, but not recommended
|
||||
for performance reasons, except for scst_user, where they are not
|
||||
supported, because this module deals with user supplied memory on a
|
||||
zero-copy manner. Consider change VMSPLIT option or use 64-bit system
|
||||
configuration instead.
|
||||
|
||||
For changing VMSPLIT option (CONFIG_VMSPLIT to be precise) you should in
|
||||
"make menuconfig" command set the following variables:
|
||||
|
||||
- General setup->Configure standard kernel features (for small systems): ON
|
||||
|
||||
- Processor type and features->High Memory Support: OFF
|
||||
|
||||
- Processor type and features->Memory split: according to amount of
|
||||
memory you have. If it is less than 800MB, you may not touch this
|
||||
option at all.
|
||||
|
||||
Module parameters
|
||||
-----------------
|
||||
|
||||
@@ -491,7 +503,7 @@ exception that it supports O_DIRECT mode. This mode is basically the
|
||||
same as BLOCKIO, but also supports files, so for some loads it could be
|
||||
significantly faster, than regular FILEIO access, provided by
|
||||
scst_vdisk. All the words about BLOCKIO from above apply to O_DIRECT as
|
||||
well. While running fileio_tgt if you don't uderstand some its options,
|
||||
well. While running fileio_tgt if you don't understand some its options,
|
||||
use defaults for them, those values are the fastest.
|
||||
|
||||
Performance
|
||||
@@ -606,7 +618,7 @@ Thanks to:
|
||||
|
||||
* Nathaniel Clark <nate@misrule.us> for fixes and comments.
|
||||
|
||||
* Calvin Morrow <calvin.morrow@comcast.net> for testing and usful
|
||||
* Calvin Morrow <calvin.morrow@comcast.net> for testing and useful
|
||||
suggestions.
|
||||
|
||||
* Hu Gang <hugang@soulinfo.com> for the original version of the
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
--- linux-2.6.12-rc6/drivers/scsi/scsi_lib.c_scst 2005-06-15 16:15:01.000000000 +0400
|
||||
+++ linux-2.6.12-rc6/drivers/scsi/scsi_lib.c 2005-06-23 20:28:20.802971272 +0400
|
||||
@@ -235,6 +235,61 @@ void scsi_do_req(struct scsi_request *sr
|
||||
}
|
||||
EXPORT_SYMBOL(scsi_do_req);
|
||||
|
||||
+/*
|
||||
+ * Function: scsi_do_req_fifo
|
||||
+ *
|
||||
+ * Purpose: Queue a SCSI request
|
||||
+ *
|
||||
+ * Arguments: sreq - command descriptor.
|
||||
+ * cmnd - actual SCSI command to be performed.
|
||||
+ * buffer - data buffer.
|
||||
+ * bufflen - size of data buffer.
|
||||
+ * done - completion function to be run.
|
||||
+ * timeout - how long to let it run before timeout.
|
||||
+ * retries - number of retries we allow.
|
||||
+ *
|
||||
+ * Lock status: No locks held upon entry.
|
||||
+ *
|
||||
+ * Returns: Nothing.
|
||||
+ *
|
||||
+ * Notes: This function is used for queueing requests in FIFO order.
|
||||
+ * It is a copy of scsi_do_req() with only changed the last
|
||||
+ * parameter of scsi_insert_special_req(). Not sure, if it
|
||||
+ * breaks quiesce, but, anyway, I don't see another way to
|
||||
+ * queue requests in FIFO order, which is necessary for SCST.
|
||||
+ */
|
||||
+void scsi_do_req_fifo(struct scsi_request *sreq, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done)(struct scsi_cmnd *),
|
||||
+ int timeout, int retries)
|
||||
+{
|
||||
+ /*
|
||||
+ * If the upper level driver is reusing these things, then
|
||||
+ * we should release the low-level block now. Another one will
|
||||
+ * be allocated later when this request is getting queued.
|
||||
+ */
|
||||
+ __scsi_release_request(sreq);
|
||||
+
|
||||
+ /*
|
||||
+ * Our own function scsi_done (which marks the host as not busy,
|
||||
+ * disables the timeout counter, etc) will be called by us or by the
|
||||
+ * scsi_hosts[host].queuecommand() function needs to also call
|
||||
+ * the completion function for the high level driver.
|
||||
+ */
|
||||
+ memcpy(sreq->sr_cmnd, cmnd, sizeof(sreq->sr_cmnd));
|
||||
+ sreq->sr_bufflen = bufflen;
|
||||
+ sreq->sr_buffer = buffer;
|
||||
+ sreq->sr_allowed = retries;
|
||||
+ sreq->sr_done = done;
|
||||
+ sreq->sr_timeout_per_command = timeout;
|
||||
+
|
||||
+ if (sreq->sr_cmd_len == 0)
|
||||
+ sreq->sr_cmd_len = COMMAND_SIZE(sreq->sr_cmnd[0]);
|
||||
+
|
||||
+ scsi_insert_special_req(sreq, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL(scsi_do_req_fifo);
|
||||
+
|
||||
static void scsi_wait_done(struct scsi_cmnd *cmd)
|
||||
{
|
||||
struct request *req = cmd->request;
|
||||
--- linux-2.6.12-rc6/include/scsi/scsi_request.h_scst 2005-06-23 20:08:59.475519880 +0400
|
||||
+++ linux-2.6.12-rc6/include/scsi/scsi_request.h 2005-06-23 20:08:26.881474928 +0400
|
||||
@@ -54,6 +54,10 @@ extern void scsi_do_req(struct scsi_requ
|
||||
void *buffer, unsigned bufflen,
|
||||
void (*done) (struct scsi_cmnd *),
|
||||
int timeout, int retries);
|
||||
+extern void scsi_do_req_fifo(struct scsi_request *, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done) (struct scsi_cmnd *),
|
||||
+ int timeout, int retries);
|
||||
|
||||
struct scsi_mode_data {
|
||||
__u32 length;
|
||||
@@ -1,75 +0,0 @@
|
||||
--- linux-2.6.15.6/drivers/scsi/scsi_lib.c_scst 2006-03-05 22:07:54.000000000 +0300
|
||||
+++ linux-2.6.15.6/drivers/scsi/scsi_lib.c 2006-03-27 17:56:59.000000000 +0400
|
||||
@@ -254,6 +254,61 @@
|
||||
}
|
||||
EXPORT_SYMBOL(scsi_do_req);
|
||||
|
||||
+/*
|
||||
+ * Function: scsi_do_req_fifo
|
||||
+ *
|
||||
+ * Purpose: Queue a SCSI request
|
||||
+ *
|
||||
+ * Arguments: sreq - command descriptor.
|
||||
+ * cmnd - actual SCSI command to be performed.
|
||||
+ * buffer - data buffer.
|
||||
+ * bufflen - size of data buffer.
|
||||
+ * done - completion function to be run.
|
||||
+ * timeout - how long to let it run before timeout.
|
||||
+ * retries - number of retries we allow.
|
||||
+ *
|
||||
+ * Lock status: No locks held upon entry.
|
||||
+ *
|
||||
+ * Returns: Nothing.
|
||||
+ *
|
||||
+ * Notes: This function is used for queueing requests in FIFO order.
|
||||
+ * It is a copy of scsi_do_req() with only changed the last
|
||||
+ * parameter of scsi_insert_special_req(). Not sure, if it
|
||||
+ * breaks quiesce, but, anyway, I don't see another way to
|
||||
+ * queue requests in FIFO order, which is necessary for SCST.
|
||||
+ */
|
||||
+void scsi_do_req_fifo(struct scsi_request *sreq, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done)(struct scsi_cmnd *),
|
||||
+ int timeout, int retries)
|
||||
+{
|
||||
+ /*
|
||||
+ * If the upper level driver is reusing these things, then
|
||||
+ * we should release the low-level block now. Another one will
|
||||
+ * be allocated later when this request is getting queued.
|
||||
+ */
|
||||
+ __scsi_release_request(sreq);
|
||||
+
|
||||
+ /*
|
||||
+ * Our own function scsi_done (which marks the host as not busy,
|
||||
+ * disables the timeout counter, etc) will be called by us or by the
|
||||
+ * scsi_hosts[host].queuecommand() function needs to also call
|
||||
+ * the completion function for the high level driver.
|
||||
+ */
|
||||
+ memcpy(sreq->sr_cmnd, cmnd, sizeof(sreq->sr_cmnd));
|
||||
+ sreq->sr_bufflen = bufflen;
|
||||
+ sreq->sr_buffer = buffer;
|
||||
+ sreq->sr_allowed = retries;
|
||||
+ sreq->sr_done = done;
|
||||
+ sreq->sr_timeout_per_command = timeout;
|
||||
+
|
||||
+ if (sreq->sr_cmd_len == 0)
|
||||
+ sreq->sr_cmd_len = COMMAND_SIZE(sreq->sr_cmnd[0]);
|
||||
+
|
||||
+ scsi_insert_special_req(sreq, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL(scsi_do_req_fifo);
|
||||
+
|
||||
/**
|
||||
* scsi_execute - insert request and wait for the result
|
||||
* @sdev: scsi device
|
||||
--- linux-2.6.15.6/include/scsi/scsi_request.h_scst 2006-03-27 17:54:21.000000000 +0400
|
||||
+++ linux-2.6.15.6/include/scsi/scsi_request.h 2006-03-27 17:56:00.000000000 +0400
|
||||
@@ -51,4 +51,8 @@
|
||||
void *buffer, unsigned bufflen,
|
||||
void (*done) (struct scsi_cmnd *),
|
||||
int timeout, int retries);
|
||||
+extern void scsi_do_req_fifo(struct scsi_request *, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done) (struct scsi_cmnd *),
|
||||
+ int timeout, int retries);
|
||||
#endif /* _SCSI_SCSI_REQUEST_H */
|
||||
@@ -1,77 +0,0 @@
|
||||
--- linux-2.6.16/drivers/scsi/scsi_lib.c.orig 2006-03-20 00:53:29.000000000 -0500
|
||||
+++ linux-2.6.16/drivers/scsi/scsi_lib.c 2006-04-07 10:04:42.077637750 -0400
|
||||
@@ -227,6 +227,63 @@ void scsi_do_req(struct scsi_request *sr
|
||||
}
|
||||
EXPORT_SYMBOL(scsi_do_req);
|
||||
|
||||
+/*
|
||||
+ * Function: scsi_do_req_fifo
|
||||
+ *
|
||||
+ * Purpose: Queue a SCSI request
|
||||
+ *
|
||||
+ * Arguments: sreq - command descriptor.
|
||||
+ * cmnd - actual SCSI command to be performed.
|
||||
+ * buffer - data buffer.
|
||||
+ * bufflen - size of data buffer.
|
||||
+ * done - completion function to be run.
|
||||
+ * timeout - how long to let it run before timeout.
|
||||
+ * retries - number of retries we allow.
|
||||
+ *
|
||||
+ * Lock status: No locks held upon entry.
|
||||
+ *
|
||||
+ * Returns: Nothing.
|
||||
+ *
|
||||
+ * Notes: This function is used for queueing requests in FIFO order.
|
||||
+ * It is a copy of scsi_do_req() with only changed the last
|
||||
+ * parameter of scsi_insert_special_req(). Not sure, if it
|
||||
+ * breaks quiesce, but, anyway, I don't see another way to
|
||||
+ * queue requests in FIFO order, which is necessary for SCST.
|
||||
+ */
|
||||
+void scsi_do_req_fifo(struct scsi_request *sreq, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done)(struct scsi_cmnd *),
|
||||
+ int timeout, int retries)
|
||||
+{
|
||||
+ /*
|
||||
+ * If the upper level driver is reusing these things, then
|
||||
+ * we should release the low-level block now. Another one will
|
||||
+ * be allocated later when this request is getting queued.
|
||||
+ */
|
||||
+ __scsi_release_request(sreq);
|
||||
+
|
||||
+ /*
|
||||
+ * Our own function scsi_done (which marks the host as not busy,
|
||||
+ * disables the timeout counter, etc) will be called by us or by the
|
||||
+ * scsi_hosts[host].queuecommand() function needs to also call
|
||||
+ * the completion function for the high level driver.
|
||||
+ */
|
||||
+ memcpy(sreq->sr_cmnd, cmnd, sizeof(sreq->sr_cmnd));
|
||||
+ sreq->sr_bufflen = bufflen;
|
||||
+ sreq->sr_buffer = buffer;
|
||||
+ sreq->sr_allowed = retries;
|
||||
+ sreq->sr_done = done;
|
||||
+ sreq->sr_timeout_per_command = timeout;
|
||||
+
|
||||
+ if (sreq->sr_cmd_len == 0)
|
||||
+ sreq->sr_cmd_len = COMMAND_SIZE(sreq->sr_cmnd[0]);
|
||||
+
|
||||
+ sreq->sr_request->flags &= ~REQ_DONTPREP;
|
||||
+ blk_insert_request(sreq->sr_device->request_queue, sreq->sr_request,
|
||||
+ 1, sreq);
|
||||
+}
|
||||
+EXPORT_SYMBOL(scsi_do_req_fifo);
|
||||
+
|
||||
/**
|
||||
* scsi_execute - insert request and wait for the result
|
||||
* @sdev: scsi device
|
||||
--- linux-2.6.16/include/scsi/scsi_request.h.orig 2006-04-07 10:06:02.506664250 -0400
|
||||
+++ linux-2.6.16/include/scsi/scsi_request.h 2006-04-07 10:06:19.039697500 -0400
|
||||
@@ -51,4 +51,8 @@ extern void scsi_do_req(struct scsi_requ
|
||||
void *buffer, unsigned bufflen,
|
||||
void (*done) (struct scsi_cmnd *),
|
||||
int timeout, int retries);
|
||||
+extern void scsi_do_req_fifo(struct scsi_request *, const void *cmnd,
|
||||
+ void *buffer, unsigned bufflen,
|
||||
+ void (*done) (struct scsi_cmnd *),
|
||||
+ int timeout, int retries);
|
||||
#endif /* _SCSI_SCSI_REQUEST_H */
|
||||
@@ -1,106 +0,0 @@
|
||||
--- linux-2.6.18.1-scst-dbg/drivers/scsi/scsi_lib.c_scst 2006-09-20 07:42:06.000000000 +0400
|
||||
+++ linux-2.6.18.1-scst-dbg/drivers/scsi/scsi_lib.c 2006-10-25 20:52:58.000000000 +0400
|
||||
@@ -367,7 +367,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
- * scsi_execute_async - insert request
|
||||
+ * __scsi_execute_async - insert request
|
||||
* @sdev: scsi device
|
||||
* @cmd: scsi command
|
||||
* @cmd_len: length of scsi cdb
|
||||
@@ -378,11 +378,14 @@
|
||||
* @timeout: request timeout in seconds
|
||||
* @retries: number of times to retry request
|
||||
* @flags: or into request flags
|
||||
+ * @at_head: insert request at head or tail of queue
|
||||
**/
|
||||
-int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+static inline int __scsi_execute_async(struct scsi_device *sdev,
|
||||
+ const unsigned char *cmd,
|
||||
int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
int use_sg, int timeout, int retries, void *privdata,
|
||||
- void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp,
|
||||
+ int at_head)
|
||||
{
|
||||
struct request *req;
|
||||
struct scsi_io_context *sioc;
|
||||
@@ -418,7 +421,7 @@
|
||||
sioc->data = privdata;
|
||||
sioc->done = done;
|
||||
|
||||
- blk_execute_rq_nowait(req->q, NULL, req, 1, scsi_end_async);
|
||||
+ blk_execute_rq_nowait(req->q, NULL, req, at_head, scsi_end_async);
|
||||
return 0;
|
||||
|
||||
free_req:
|
||||
@@ -427,8 +430,53 @@
|
||||
kfree(sioc);
|
||||
return DRIVER_ERROR << 24;
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * scsi_execute_async - insert request
|
||||
+ * @sdev: scsi device
|
||||
+ * @cmd: scsi command
|
||||
+ * @cmd_len: length of scsi cdb
|
||||
+ * @data_direction: data direction
|
||||
+ * @buffer: data buffer (this can be a kernel buffer or scatterlist)
|
||||
+ * @bufflen: len of buffer
|
||||
+ * @use_sg: if buffer is a scatterlist this is the number of elements
|
||||
+ * @timeout: request timeout in seconds
|
||||
+ * @retries: number of times to retry request
|
||||
+ * @flags: or into request flags
|
||||
+ **/
|
||||
+int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+ int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
+ int use_sg, int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+{
|
||||
+ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
|
||||
+ bufflen, use_sg, timeout, retries, privdata, done, gfp, 1);
|
||||
+}
|
||||
EXPORT_SYMBOL_GPL(scsi_execute_async);
|
||||
|
||||
+/**
|
||||
+ * scsi_execute_async_fifi - insert request at tail, in FIFO order
|
||||
+ * @sdev: scsi device
|
||||
+ * @cmd: scsi command
|
||||
+ * @cmd_len: length of scsi cdb
|
||||
+ * @data_direction: data direction
|
||||
+ * @buffer: data buffer (this can be a kernel buffer or scatterlist)
|
||||
+ * @bufflen: len of buffer
|
||||
+ * @use_sg: if buffer is a scatterlist this is the number of elements
|
||||
+ * @timeout: request timeout in seconds
|
||||
+ * @retries: number of times to retry request
|
||||
+ * @flags: or into request flags
|
||||
+ **/
|
||||
+int scsi_execute_async_fifo(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+ int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
+ int use_sg, int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+{
|
||||
+ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
|
||||
+ bufflen, use_sg, timeout, retries, privdata, done, gfp, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(scsi_execute_async_fifo);
|
||||
+
|
||||
/*
|
||||
* Function: scsi_init_cmd_errh()
|
||||
*
|
||||
--- linux-2.6.18.1-scst-dbg/include/scsi/scsi_device.h_scst 2006-09-20 07:42:06.000000000 +0400
|
||||
+++ linux-2.6.18.1-scst-dbg/include/scsi/scsi_device.h 2006-10-25 20:09:23.000000000 +0400
|
||||
@@ -297,6 +297,12 @@
|
||||
int timeout, int retries, void *privdata,
|
||||
void (*done)(void *, char *, int, int),
|
||||
gfp_t gfp);
|
||||
+extern int scsi_execute_async_fifo(struct scsi_device *sdev,
|
||||
+ const unsigned char *cmd, int cmd_len, int data_direction,
|
||||
+ void *buffer, unsigned bufflen, int use_sg,
|
||||
+ int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int),
|
||||
+ gfp_t gfp);
|
||||
|
||||
static inline void scsi_device_reprobe(struct scsi_device *sdev)
|
||||
{
|
||||
@@ -1,106 +0,0 @@
|
||||
--- linux-2.6.21.1-scst-dbg/drivers/scsi/scsi_lib.c.orig 2007-04-28 01:49:26.000000000 +0400
|
||||
+++ linux-2.6.21.1-scst-dbg/drivers/scsi/scsi_lib.c 2007-05-02 13:37:38.000000000 +0400
|
||||
@@ -366,7 +366,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
- * scsi_execute_async - insert request
|
||||
+ * __scsi_execute_async - insert request
|
||||
* @sdev: scsi device
|
||||
* @cmd: scsi command
|
||||
* @cmd_len: length of scsi cdb
|
||||
@@ -377,11 +377,14 @@
|
||||
* @timeout: request timeout in seconds
|
||||
* @retries: number of times to retry request
|
||||
* @flags: or into request flags
|
||||
+ * @at_head: insert request at head or tail of queue
|
||||
**/
|
||||
-int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+static inline int __scsi_execute_async(struct scsi_device *sdev,
|
||||
+ const unsigned char *cmd,
|
||||
int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
int use_sg, int timeout, int retries, void *privdata,
|
||||
- void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp,
|
||||
+ int at_head)
|
||||
{
|
||||
struct request *req;
|
||||
struct scsi_io_context *sioc;
|
||||
@@ -418,7 +421,7 @@
|
||||
sioc->data = privdata;
|
||||
sioc->done = done;
|
||||
|
||||
- blk_execute_rq_nowait(req->q, NULL, req, 1, scsi_end_async);
|
||||
+ blk_execute_rq_nowait(req->q, NULL, req, at_head, scsi_end_async);
|
||||
return 0;
|
||||
|
||||
free_req:
|
||||
@@ -427,8 +430,53 @@
|
||||
kmem_cache_free(scsi_io_context_cache, sioc);
|
||||
return DRIVER_ERROR << 24;
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * scsi_execute_async - insert request
|
||||
+ * @sdev: scsi device
|
||||
+ * @cmd: scsi command
|
||||
+ * @cmd_len: length of scsi cdb
|
||||
+ * @data_direction: data direction
|
||||
+ * @buffer: data buffer (this can be a kernel buffer or scatterlist)
|
||||
+ * @bufflen: len of buffer
|
||||
+ * @use_sg: if buffer is a scatterlist this is the number of elements
|
||||
+ * @timeout: request timeout in seconds
|
||||
+ * @retries: number of times to retry request
|
||||
+ * @flags: or into request flags
|
||||
+ **/
|
||||
+int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+ int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
+ int use_sg, int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+{
|
||||
+ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
|
||||
+ bufflen, use_sg, timeout, retries, privdata, done, gfp, 1);
|
||||
+}
|
||||
EXPORT_SYMBOL_GPL(scsi_execute_async);
|
||||
|
||||
+/**
|
||||
+ * scsi_execute_async_fifi - insert request at tail, in FIFO order
|
||||
+ * @sdev: scsi device
|
||||
+ * @cmd: scsi command
|
||||
+ * @cmd_len: length of scsi cdb
|
||||
+ * @data_direction: data direction
|
||||
+ * @buffer: data buffer (this can be a kernel buffer or scatterlist)
|
||||
+ * @bufflen: len of buffer
|
||||
+ * @use_sg: if buffer is a scatterlist this is the number of elements
|
||||
+ * @timeout: request timeout in seconds
|
||||
+ * @retries: number of times to retry request
|
||||
+ * @flags: or into request flags
|
||||
+ **/
|
||||
+int scsi_execute_async_fifo(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
+ int cmd_len, int data_direction, void *buffer, unsigned bufflen,
|
||||
+ int use_sg, int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int), gfp_t gfp)
|
||||
+{
|
||||
+ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
|
||||
+ bufflen, use_sg, timeout, retries, privdata, done, gfp, 0);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(scsi_execute_async_fifo);
|
||||
+
|
||||
/*
|
||||
* Function: scsi_init_cmd_errh()
|
||||
*
|
||||
--- linux-2.6.21.1-scst-dbg/include/scsi/scsi_device.h.orig 2007-04-28 01:49:26.000000000 +0400
|
||||
+++ linux-2.6.21.1-scst-dbg/include/scsi/scsi_device.h 2007-05-02 13:37:38.000000000 +0400
|
||||
@@ -298,6 +298,12 @@
|
||||
int timeout, int retries, void *privdata,
|
||||
void (*done)(void *, char *, int, int),
|
||||
gfp_t gfp);
|
||||
+extern int scsi_execute_async_fifo(struct scsi_device *sdev,
|
||||
+ const unsigned char *cmd, int cmd_len, int data_direction,
|
||||
+ void *buffer, unsigned bufflen, int use_sg,
|
||||
+ int timeout, int retries, void *privdata,
|
||||
+ void (*done)(void *, char *, int, int),
|
||||
+ gfp_t gfp);
|
||||
|
||||
static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev)
|
||||
{
|
||||
@@ -98,7 +98,6 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter
|
||||
#EXTRA_CFLAGS += -DSTRICT_SERIALIZING
|
||||
|
||||
EXTRA_CFLAGS += -DEXTRACHECKS
|
||||
#EXTRA_CFLAGS += -DVDISK_ONLY
|
||||
|
||||
#EXTRA_CFLAGS += -fno-inline
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@
|
||||
#include "scst_user.h"
|
||||
#include "scst_dev_handler.h"
|
||||
|
||||
#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT)
|
||||
#warning HIGHMEM kernel configurations are not supported. Consider \
|
||||
changing VMSPLIT option or using 64-bit configuration.
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
#warning HIGHMEM kernel configurations are not supported by this module, \
|
||||
because nowadays it doesn't worth the effort. Consider change \
|
||||
VMSPLIT option or use 64-bit configuration instead. See README file \
|
||||
for details.
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) && defined(CONFIG_DEBUG_SLAB)
|
||||
@@ -2933,10 +2935,10 @@ static int __init init_scst_user(void)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT)
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
PRINT_ERROR_PR("%s", "HIGHMEM kernel configurations are not supported. "
|
||||
"Consider changing VMSPLIT option or using 64-bit "
|
||||
"configuration.");
|
||||
"Consider change VMSPLIT option or use 64-bit "
|
||||
"configuration instead. See README file for details.");
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
#endif
|
||||
|
||||
+22
-9
@@ -32,15 +32,27 @@
|
||||
#include "scst_priv.h"
|
||||
#include "scst_mem.h"
|
||||
|
||||
#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT)
|
||||
#warning HIGHMEM kernel configurations are supported, but not recommended. \
|
||||
Consider changing VMSPLIT option or using 64-bit configuration instead.
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
#warning HIGHMEM kernel configurations are fully supported, but not \
|
||||
recommended for performance reasons. Consider change VMSPLIT \
|
||||
option or use 64-bit configuration instead. See README file for \
|
||||
details.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All targets, devices and dev_types management is done under
|
||||
* this mutex.
|
||||
*/
|
||||
#ifdef SCST_HIGHMEM
|
||||
#error SCST_HIGHMEM configuration isn't supported and broken, because there \
|
||||
is no real point to support it, at least it definitely doesn't worth \
|
||||
the effort. Better use no-HIGHMEM kernel with VMSPLIT option \
|
||||
or in 64-bit configuration instead. See README file for details.
|
||||
#endif
|
||||
|
||||
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING)
|
||||
#warning Patch scst_exec_req_fifo.patch was not applied on your kernel and \
|
||||
STRICT_SERIALIZING isn't defined. Pass-through dev handlers will \
|
||||
not be supported.
|
||||
#endif
|
||||
|
||||
/* All targets, devices and dev_types management is done under this mutex */
|
||||
DECLARE_MUTEX(scst_mutex);
|
||||
|
||||
LIST_HEAD(scst_template_list);
|
||||
@@ -732,10 +744,11 @@ int scst_register_dev_driver(struct scst_dev_type *dev_type)
|
||||
if (res != 0)
|
||||
goto out_err;
|
||||
|
||||
#ifdef VDISK_ONLY
|
||||
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING)
|
||||
if (dev_type->exec == NULL) {
|
||||
PRINT_ERROR_PR("Pass-through dev handlers (handler \"%s\") not "
|
||||
"supported. Recompile SCST with undefined VDISK_ONLY",
|
||||
"supported. Consider applying on your kernel patch "
|
||||
"scst_exec_req_fifo.patch or define STRICT_SERIALIZING",
|
||||
dev_type->name);
|
||||
res = -EINVAL;
|
||||
goto out_err;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "scst_debug.h"
|
||||
#include "scsi_tgt.h"
|
||||
#include "scst_debug.h"
|
||||
|
||||
#if defined(DEBUG) || defined(TRACING)
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ static inline void scst_do_req(struct scsi_request *sreq,
|
||||
{
|
||||
#ifdef STRICT_SERIALIZING
|
||||
scsi_do_req(sreq, cmnd, buffer, bufflen, done, timeout, retries);
|
||||
#elif defined(VDISK_ONLY)
|
||||
#elif !defined(SCSI_EXEC_REQ_FIFO_DEFINED)
|
||||
sBUG();
|
||||
#else
|
||||
scsi_do_req_fifo(sreq, cmnd, buffer, bufflen, done, timeout, retries);
|
||||
@@ -328,7 +328,7 @@ static inline int scst_exec_req(struct scsi_device *sdev,
|
||||
#ifdef STRICT_SERIALIZING
|
||||
return scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
|
||||
bufflen, use_sg, timeout, retries, privdata, done, gfp);
|
||||
#elif defined(VDISK_ONLY)
|
||||
#elif !defined(SCSI_EXEC_REQ_FIFO_DEFINED)
|
||||
sBUG();
|
||||
return -1;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user