slab.h (7fdce5c42bf95fc75b481e1357a960031a360d44) | slab.h (be48ab92ac55e1168fdf49c4a046cea6747ad575) |
---|---|
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 --- 29 unchanged lines hidden (view full) --- 38 39#include <linux/types.h> 40#include <linux/gfp.h> 41 42MALLOC_DECLARE(M_KMALLOC); 43 44#define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) 45#define kvmalloc(size) kmalloc((size), 0) | 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 --- 29 unchanged lines hidden (view full) --- 38 39#include <linux/types.h> 40#include <linux/gfp.h> 41 42MALLOC_DECLARE(M_KMALLOC); 43 44#define kmalloc(size, flags) malloc((size), M_KMALLOC, (flags)) 45#define kvmalloc(size) kmalloc((size), 0) |
46#define kzalloc(size, flags) kmalloc((size), (flags) | M_ZERO) | 46#define kzalloc(size, flags) kmalloc((size), M_ZERO | ((flags) ? (flags) : M_NOWAIT)) |
47#define kzalloc_node(size, flags, node) kzalloc(size, flags) 48#define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) 49#define kfree_const(ptr) kfree(ptr) 50#define krealloc(ptr, size, flags) realloc((ptr), (size), M_KMALLOC, (flags)) 51#define kcalloc(n, size, flags) kmalloc((n) * (size), flags | M_ZERO) 52#define vzalloc(size) kzalloc(size, GFP_KERNEL | __GFP_NOWARN) 53#define vfree(arg) kfree(arg) 54#define kvfree(arg) kfree(arg) --- 70 unchanged lines hidden --- | 47#define kzalloc_node(size, flags, node) kzalloc(size, flags) 48#define kfree(ptr) free(__DECONST(void *, (ptr)), M_KMALLOC) 49#define kfree_const(ptr) kfree(ptr) 50#define krealloc(ptr, size, flags) realloc((ptr), (size), M_KMALLOC, (flags)) 51#define kcalloc(n, size, flags) kmalloc((n) * (size), flags | M_ZERO) 52#define vzalloc(size) kzalloc(size, GFP_KERNEL | __GFP_NOWARN) 53#define vfree(arg) kfree(arg) 54#define kvfree(arg) kfree(arg) --- 70 unchanged lines hidden --- |