From 687d0a734c760f0ce25e86ab0624cae908042170 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 21 Jul 2018 16:43:33 +0000 Subject: [PATCH 1/2] isert-scst: Rework r7429 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7430 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_global.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index fc64702cb..a7882c7b2 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -144,8 +144,10 @@ int isert_global_init(void) return -ENOMEM; } - isert_cmnd_cache = KMEM_CACHE_USERCOPY(isert_cmnd, - SCST_SLAB_FLAGS|SLAB_HWCACHE_ALIGN); + isert_cmnd_cache = kmem_cache_create_usercopy("isert_cmnd", + sizeof(struct isert_cmnd), __alignof__(struct isert_cmnd), + SCST_SLAB_FLAGS | SLAB_HWCACHE_ALIGN, + 0, sizeof(struct isert_cmnd), NULL); if (!isert_cmnd_cache) { destroy_workqueue(isert_glob.conn_wq); PRINT_ERROR("Failed to alloc iser command cache"); From 687c55143d295de51530c6759f3b42f03b0962d0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 21 Jul 2018 16:46:16 +0000 Subject: [PATCH 2/2] scst: Fix kmem_cache_create_usercopy() backport slab_flags_t is not available in the kernel versions kmem_cache_create_usercopy() has been backported to, hence use unsigned long instead. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7431 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 02372f453..f2db2cbe8 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -678,7 +678,7 @@ static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name, unsigned int size, unsigned int align, - slab_flags_t flags, + unsigned long flags, unsigned int useroffset, unsigned int usersize, void (*ctor)(void *)) { @@ -687,7 +687,7 @@ static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name, #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name, unsigned int size, unsigned int align, - slab_flags_t flags, + unsigned long flags, unsigned int useroffset, unsigned int usersize, void (*ctor)(void *)) {