diff --git a/scst/include/backport.h b/scst/include/backport.h index ac1e6430f..c8a4ae869 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -357,6 +357,14 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref) } #endif +/* */ + +/* See also commit 207205a2ba26 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) +#define kthread_create_on_node(threadfn, data, node, namefmt, arg...)\ + kthread_create((threadfn), (data), ##arg) +#endif + /* */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) && \ diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 735261405..c35137b55 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8390,15 +8390,18 @@ static void scsi_end_async(struct request *req, int error) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) resid_len = scsi_req(req)->resid_len; -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) resid_len = req->resid_len; +#else + /* + * A quote from commit c3a4d78c580d: "rq->data_len served two + * purposes - the length of data buffer on issue and the + * residual count on completion." + */ + resid_len = req->data_len; #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) sioc->done(sioc->data, sioc->sense, result, resid_len); -#else - sioc->done(sioc->data, sioc->sense, result, req->data_len); -#endif } kmem_cache_free(scsi_io_context_cache, sioc);