Follow r256586 and rename the kernel version of the Free() macro to

R_Free().  This matches the other macros and reduces the chances to clash
with other headers.

This also fixes the build of radix.c outside of the kernel environment.

Reviewed by:	glebius
This commit is contained in:
loos 2015-07-30 02:09:03 +00:00
parent d188afab8d
commit 79c1792263
3 changed files with 10 additions and 10 deletions

View File

@ -533,7 +533,7 @@ rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip)
x = rn_insert(cp, maskhead, &maskduplicated, x);
if (maskduplicated) {
log(LOG_ERR, "rn_addmask: mask impossibly already in tree");
Free(saved_x);
R_Free(saved_x);
return (x);
}
/*
@ -829,7 +829,7 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head)
for (mp = &x->rn_mklist; (m = *mp); mp = &m->rm_mklist)
if (m == saved_m) {
*mp = m->rm_mklist;
Free(m);
R_Free(m);
break;
}
if (m == 0) {
@ -920,7 +920,7 @@ rn_delete(void *v_arg, void *netmask_arg, struct radix_node_head *head)
struct radix_mask *mm = m->rm_mklist;
x->rn_mklist = 0;
if (--(m->rm_refs) < 0)
Free(m);
R_Free(m);
m = mm;
}
if (m)
@ -1152,7 +1152,7 @@ rn_detachhead_internal(void **head)
rnh = *head;
/* Free <left,root,right> nodes. */
Free(rnh);
R_Free(rnh);
*head = NULL;
}
@ -1186,7 +1186,7 @@ rn_freeentry(struct radix_node *rn, void *arg)
x = (struct radix_node *)rn_delete(rn + 2, NULL, rnh);
if (x != NULL)
Free(x);
R_Free(x);
return (0);
}

View File

@ -137,7 +137,7 @@ struct radix_node_head {
#else
#define R_Malloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT))
#define R_Zalloc(p, t, n) (p = (t) malloc((unsigned long)(n), M_RTABLE, M_NOWAIT | M_ZERO))
#define Free(p) free((caddr_t)p, M_RTABLE);
#define R_Free(p) free((caddr_t)p, M_RTABLE);
#define RADIX_NODE_HEAD_LOCK_INIT(rnh) \
rw_init_flags(&(rnh)->rnh_lock, "radix node head", 0)

View File

@ -519,7 +519,7 @@ rtfree(struct rtentry *rt)
* This also frees the gateway, as they are always malloc'd
* together.
*/
Free(rt_key(rt));
R_Free(rt_key(rt));
/*
* and the rtentry itself of course
@ -1352,7 +1352,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
if (rn_mpath_capable(rnh) &&
rt_mpath_conflict(rnh, rt, netmask)) {
ifa_free(rt->rt_ifa);
Free(rt_key(rt));
R_Free(rt_key(rt));
uma_zfree(V_rtzone, rt);
senderr(EEXIST);
}
@ -1419,7 +1419,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
*/
if (rn == NULL) {
ifa_free(rt->rt_ifa);
Free(rt_key(rt));
R_Free(rt_key(rt));
uma_zfree(V_rtzone, rt);
#ifdef FLOWTABLE
if (rt0 != NULL)
@ -1641,7 +1641,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate)
* Free()/free() handle a NULL argument just fine.
*/
bcopy(dst, new, dlen);
Free(rt_key(rt)); /* free old block, if any */
R_Free(rt_key(rt)); /* free old block, if any */
rt_key(rt) = (struct sockaddr *)new;
rt->rt_gateway = (struct sockaddr *)(new + dlen);
}