|
@@ -3151,8 +3151,12 @@ static int req_prot_init(const struct proto *prot)
|
|
int proto_register(struct proto *prot, int alloc_slab)
|
|
int proto_register(struct proto *prot, int alloc_slab)
|
|
{
|
|
{
|
|
if (alloc_slab) {
|
|
if (alloc_slab) {
|
|
- prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
|
|
|
|
|
|
+ prot->slab = kmem_cache_create_usercopy(prot->name,
|
|
|
|
+ prot->obj_size, 0,
|
|
SLAB_HWCACHE_ALIGN | prot->slab_flags,
|
|
SLAB_HWCACHE_ALIGN | prot->slab_flags,
|
|
|
|
+ prot->usersize ? prot->useroffset : 0,
|
|
|
|
+ prot->usersize ? prot->usersize
|
|
|
|
+ : prot->obj_size,
|
|
NULL);
|
|
NULL);
|
|
|
|
|
|
if (prot->slab == NULL) {
|
|
if (prot->slab == NULL) {
|