| .. | .. |
|---|
| 12 | 12 | /* constructor called during alocation */ |
|---|
| 13 | 13 | int (*construct)(struct hwbm_pool *bm_pool, void *buf); |
|---|
| 14 | 14 | /* protect acces to the buffer counter*/ |
|---|
| 15 | | - spinlock_t lock; |
|---|
| 15 | + struct mutex buf_lock; |
|---|
| 16 | 16 | /* private data */ |
|---|
| 17 | 17 | void *priv; |
|---|
| 18 | 18 | }; |
|---|
| 19 | 19 | #ifdef CONFIG_HWBM |
|---|
| 20 | 20 | void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf); |
|---|
| 21 | 21 | int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp); |
|---|
| 22 | | -int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp); |
|---|
| 22 | +int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num); |
|---|
| 23 | 23 | #else |
|---|
| 24 | | -void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {} |
|---|
| 25 | | -int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; } |
|---|
| 26 | | -int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num, gfp_t gfp) |
|---|
| 24 | +static inline void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {} |
|---|
| 25 | + |
|---|
| 26 | +static inline int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) |
|---|
| 27 | +{ return 0; } |
|---|
| 28 | + |
|---|
| 29 | +static inline int hwbm_pool_add(struct hwbm_pool *bm_pool, |
|---|
| 30 | + unsigned int buf_num) |
|---|
| 27 | 31 | { return 0; } |
|---|
| 28 | 32 | #endif /* CONFIG_HWBM */ |
|---|
| 29 | 33 | #endif /* _HWBM_H */ |
|---|