Merge of the trunk's r3428-3435:

- Don't allow to create targets with the same names

 - Remove "unused variable" warning on old kernels

 - Fix a compiler warning on pre-2.6.35 non-RHEL systems.

 - Bug fix: do not try to apply patch readahead-2.6.32.below11.patch on kernel 2.6.32.11 or any later 2.6.32 kernel.

 - Removed the constant REPORT_DEVICE_IDENTIFIER from scst/include/scst_const.h because it is not used anywhere in the SCST source tree.

 - Expand CONFIG_SCST_PROC too.

 - Added #include <linux/slab.h> for kmem_cache_free().

 - MultiP must be 1 and HiSup 0



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3437 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2011-05-03 21:13:08 +00:00
parent d840579952
commit ef3019b48b
7 changed files with 21 additions and 9 deletions

View File

@@ -116,6 +116,10 @@ svn status -v "$(dirname "$(dirname "$scriptname")")" \
| grep -v /in-tree/ \
| while read p
do
echo "==== $p"
patch -p1 <$p
if [ "${p/readahead-2.6.32.below11.patch//}" = "$p" \
-o "${patchlevel:-0}" -lt 11 ]
then
echo "==== $p"
patch -p1 <$p
fi
done

View File

@@ -242,6 +242,7 @@ function handle_if(evaluated)
# kernel version, and do not interpret other expressions.
if ($0 ~ "LINUX_VERSION_CODE" \
|| $0 ~ "INSIDE_KERNEL_TREE" \
|| $0 ~ "CONFIG_SCST_PROC" \
|| $0 ~ "RHEL_MAJOR" \
|| $0 ~ "RHEL_MINOR" \
|| $0 ~ "RHEL_RELEASE_CODE" \

View File

@@ -272,7 +272,6 @@ enum scst_cdb_flags {
/*************************************************************
* SCSI opcodes not listed anywhere else
*************************************************************/
#define REPORT_DEVICE_IDENTIFIER 0xA3
#define INIT_ELEMENT_STATUS 0x07
#define INIT_ELEMENT_STATUS_RANGE 0x37
#define PREVENT_ALLOW_MEDIUM 0x1E

View File

@@ -1322,8 +1322,8 @@ static void vdisk_exec_unmap(struct scst_cmd *cmd, struct scst_vdisk_thr *thr)
(unsigned long long)start, len);
if (virt_dev->blockio) {
gfp_t gfp = cmd->noio_mem_alloc ? GFP_NOIO : GFP_KERNEL;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27)
gfp_t gfp = cmd->noio_mem_alloc ? GFP_NOIO : GFP_KERNEL;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31)
err = blkdev_issue_discard(inode->i_bdev, start, len,
gfp);
@@ -1577,11 +1577,11 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
if (virt_dev->removable)
buf[1] = 0x80; /* removable */
buf[2] = 5; /* Device complies to SPC-3 */
buf[3] = 0x12; /* HiSup + data in format specified in SPC */
buf[3] = 0x02; /* Data in format specified in SPC */
if (cmd->tgtt->fake_aca)
buf[3] |= 0x20;
buf[4] = 31;/* n - 4 = 35 - 4 = 31 for full 36 byte data */
buf[6] = 1; /* MultiP 1 */
buf[6] = 0x10; /* MultiP 1 */
buf[7] = 2; /* CMDQUE 1, BQue 0 => commands queuing supported */
/*

View File

@@ -473,7 +473,7 @@ EXPORT_SYMBOL(scst_unregister_target_template);
struct scst_tgt *scst_register_target(struct scst_tgt_template *vtt,
const char *target_name)
{
struct scst_tgt *tgt;
struct scst_tgt *tgt, *t;
int rc = 0;
TRACE_ENTRY();
@@ -527,6 +527,14 @@ struct scst_tgt *scst_register_target(struct scst_tgt_template *vtt,
if (rc != 0)
goto out_free_tgt;
list_for_each_entry(t, &vtt->tgt_list, tgt_list_entry) {
if (strcmp(t->tgt_name, tgt->tgt_name) == 0) {
PRINT_ERROR("target %s already exists", tgt->tgt_name);
rc = -EEXIST;
goto out_unlock;
}
}
#ifdef CONFIG_SCST_PROC
rc = scst_build_proc_target_entries(tgt);
if (rc < 0)

View File

@@ -339,7 +339,7 @@ out_unlock_put:
goto out;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) && (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6)
static int sgv_shrink(int nr, gfp_t gfpm)
#else
static int sgv_shrink(struct shrinker *shrinker, int nr, gfp_t gfpm)

View File

@@ -21,7 +21,7 @@
#define __SCST_PRIV_H
#include <linux/types.h>
#include <linux/slab.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_driver.h>