]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - include/net/hwbm.h
Merge tag 'nfsd-5.4' of git://linux-nfs.org/~bfields/linux
[mirror_ubuntu-focal-kernel.git] / include / net / hwbm.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
8cb2d8bf
GC
2#ifndef _HWBM_H
3#define _HWBM_H
4
5struct hwbm_pool {
6 /* Capacity of the pool */
7 int size;
8 /* Size of the buffers managed */
9 int frag_size;
10 /* Number of buffers currently used by this pool */
11 int buf_num;
12 /* constructor called during alocation */
13 int (*construct)(struct hwbm_pool *bm_pool, void *buf);
14 /* protect acces to the buffer counter*/
6dcdd884 15 struct mutex buf_lock;
8cb2d8bf
GC
16 /* private data */
17 void *priv;
18};
19#ifdef CONFIG_HWBM
20void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf);
21int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp);
6dcdd884 22int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num);
8cb2d8bf
GC
23#else
24void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
25int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; }
6dcdd884 26int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num)
8cb2d8bf
GC
27{ return 0; }
28#endif /* CONFIG_HWBM */
29#endif /* _HWBM_H */