diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index d2136bdd5..21815b09d 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -703,6 +703,10 @@ int iscsi_add_attr(struct iscsi_target *target, struct iscsi_attr *tgt_attr; struct list_head *attrs_list; const char *name; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ + defined(CONFIG_DEBUG_LOCK_ALLOC)) + static struct lock_class_key __key; +#endif TRACE_ENTRY(); @@ -749,6 +753,10 @@ int iscsi_add_attr(struct iscsi_target *target, tgt_attr->attr.attr.name = tgt_attr->name; tgt_attr->attr.attr.owner = THIS_MODULE; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ + defined(CONFIG_DEBUG_LOCK_ALLOC)) + tgt_attr->attr.attr.key = &__key; +#endif tgt_attr->attr.attr.mode = attr_info->mode & (S_IRUGO | S_IWUGO); tgt_attr->attr.show = iscsi_attr_show; tgt_attr->attr.store = iscsi_attr_store; diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h index d845facff..44ff05dc9 100644 --- a/scst/include/scst_const.h +++ b/scst/include/scst_const.h @@ -243,7 +243,9 @@ enum scst_cdb_flags { #define WRITE_ATTRIBUTE 0x8D #define WRITE_VERIFY_16 0x8E #define VERIFY_6 0x13 +#ifndef VERIFY_12 #define VERIFY_12 0xAF +#endif #ifndef GENERATING_UPSTREAM_PATCH /* * The constants below have been defined in the kernel header diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 314118c21..1fcbd6a4f 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -2739,7 +2739,11 @@ static int blockio_flush(struct block_device *bdev) TRACE_ENTRY(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) res = blkdev_issue_flush(bdev, NULL); +#else + res = blkdev_issue_flush(bdev, GFP_KERNEL, NULL, BLKDEV_IFL_WAIT); +#endif if (res != 0) PRINT_ERROR("blkdev_issue_flush() failed: %d", res); diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 3af17accd..18da9f5f9 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -868,8 +868,10 @@ static int scst_pr_copy_file(const char *src, const char *dest) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) res = scst_pr_vfs_fsync(file_dest, 0, file_size); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) res = vfs_fsync(file_dest, file_dest->f_path.dentry, 0); +#else + res = vfs_fsync(file_dest, 0); #endif if (res != 0) { PRINT_ERROR("fsync() of the backup PR file failed: %d", res); @@ -1035,8 +1037,10 @@ void scst_pr_sync_device_file(struct scst_tgt_dev *tgt_dev, struct scst_cmd *cmd #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) res = scst_pr_vfs_fsync(file, 0, pos); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) res = vfs_fsync(file, file->f_path.dentry, 0); +#else + res = vfs_fsync(file, 0); #endif if (res != 0) { PRINT_ERROR("fsync() of the PR file failed: %d", res); @@ -1051,8 +1055,10 @@ void scst_pr_sync_device_file(struct scst_tgt_dev *tgt_dev, struct scst_cmd *cmd #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) res = scst_pr_vfs_fsync(file, 0, sizeof(sign)); -#else +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) res = vfs_fsync(file, file->f_path.dentry, 0); +#else + res = vfs_fsync(file, 0); #endif if (res != 0) { PRINT_ERROR("fsync() of the PR file failed: %d", res); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index ae1909979..2cbf3cc36 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -2530,6 +2530,10 @@ int scst_create_acn_sysfs(struct scst_acg *acg, struct scst_acn *acn) int retval = 0; int len; struct kobj_attribute *attr = NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ + defined(CONFIG_DEBUG_LOCK_ALLOC)) + static struct lock_class_key __key; +#endif TRACE_ENTRY(); @@ -2554,6 +2558,11 @@ int scst_create_acn_sysfs(struct scst_acg *acg, struct scst_acn *acn) strlcpy((char *)attr->attr.name, acn->name, len); attr->attr.owner = THIS_MODULE; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && \ + defined(CONFIG_DEBUG_LOCK_ALLOC)) + attr->attr.key = &__key; +#endif + attr->attr.mode = S_IRUGO; attr->show = scst_acn_file_show; attr->store = NULL;