slab.h (814aaaa7da4dab462d90e12e7b48b75f2093ccfd) slab.h (b4b4b5304bd22eab265c9c049cb7fc6b55c4ef3f)
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 58 unchanged lines hidden (view full) ---

67#define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__)
68
69struct linux_kmem_cache {
70 uma_zone_t cache_zone;
71 void (*cache_ctor)(void *);
72};
73
74#define SLAB_HWCACHE_ALIGN 0x0001
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 58 unchanged lines hidden (view full) ---

67#define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__)
68
69struct linux_kmem_cache {
70 uma_zone_t cache_zone;
71 void (*cache_ctor)(void *);
72};
73
74#define SLAB_HWCACHE_ALIGN 0x0001
75static inline void *
76kmalloc_array(size_t n, size_t size, gfp_t flags)
77{
78 if (size != 0 && n > SIZE_MAX / size)
79 return (NULL);
80 return kmalloc(n * size, flags);
81}
82}
83
84static inline int
85linux_kmem_ctor(void *mem, int size, void *arg, int flags)
86{
87 void (*ctor)(void *);
88
89 ctor = arg;
90 ctor(mem);

--- 42 unchanged lines hidden ---
75
76static inline int
77linux_kmem_ctor(void *mem, int size, void *arg, int flags)
78{
79 void (*ctor)(void *);
80
81 ctor = arg;
82 ctor(mem);

--- 42 unchanged lines hidden ---