diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 31e4fe280..e289d6e52 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -14,7 +14,9 @@ #include #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) #include +#endif #include #include @@ -1289,11 +1291,18 @@ qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha) static int sp_get(struct srb *sp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + if (!atomic_inc_not_zero(&sp->ref_count)) + return ENXIO; + else + return 0; +#else if (!refcount_inc_not_zero((refcount_t*)&sp->ref_count)) /* kref get fail */ return ENXIO; else return 0; +#endif } #define ISP_REG_DISCONNECT 0xffffffffU