[LU-8931] OBD_ALLOC_POST() body should be enclosed in a do ... while (0) Created: 12/Dec/16 Updated: 16/Jun/20 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | WC Triage |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | easy | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
The definition of OBD_ALLOC_POST() needs ot be corrected so that it can be used as it it used: #define OBD_ALLOC_POST(ptr, size, name) \
obd_memory_add(size); \
CDEBUG(D_MALLOC, name " '" #ptr "': %d at %p.\n", \
(int)(size), ptr)
...
#define __OBD_MALLOC_VERBOSE(ptr, cptab, cpt, size, flags) \
do { \
(ptr) = (cptab) == NULL ? \
kmalloc(size, (flags) | __GFP_ZERO) : \
cfs_cpt_malloc(cptab, cpt, size, (flags) | __GFP_ZERO); \
if (likely((ptr) != NULL)) \
OBD_ALLOC_POST(ptr, size, "kmalloced"); \
} while (0)
|