Commit 91d33db5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add vsmw_cluster arg to VSMW_Alloc[vf]()

parent 89e295c8
......@@ -509,7 +509,7 @@ VSM_Init(void)
AN(VSC_C_main);
AN(heritage.proc_vsmw);
vsl_head = VSMW_Allocf(heritage.proc_vsmw, VSL_CLASS,
vsl_head = VSMW_Allocf(heritage.proc_vsmw, NULL, VSL_CLASS,
cache_param->vsl_space, VSL_CLASS);
AN(vsl_head);
vsl_segsize = ((cache_param->vsl_space - sizeof *vsl_head) /
......
......@@ -83,7 +83,7 @@ vrt_vsc_mksegv(const char *class, size_t payload, const char *fmt, va_list va)
co = PRNDUP(sizeof(struct vsc_head));
ALLOC_OBJ(vsg, VSC_SEG_MAGIC);
AN(vsg);
vsg->seg = VSMW_Allocv(heritage.proc_vsmw, class,
vsg->seg = VSMW_Allocv(heritage.proc_vsmw, NULL, class,
co + PRNDUP(payload), fmt, va);
AN(vsg->seg);
vsg->vsm = heritage.proc_vsmw;
......
......@@ -219,14 +219,15 @@ VSMW_DestroyCluster(struct vsmw *vsmw, struct vsmw_cluster **vcp)
/*--------------------------------------------------------------------*/
void *
VSMW_Allocv(struct vsmw *vsmw, const char *class, size_t len,
VSMW_Allocv(struct vsmw *vsmw, struct vsmw_cluster *vc,
const char *class, size_t len,
const char *fmt, va_list va)
{
struct vsmwseg *seg;
struct vsmw_cluster *vc;
int fd;
CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
(void)vc;
ALLOC_OBJ(seg, VSMWSEG_MAGIC);
AN(seg);
......@@ -256,14 +257,14 @@ VSMW_Allocv(struct vsmw *vsmw, const char *class, size_t len,
}
void *
VSMW_Allocf(struct vsmw *vsmw, const char *class, size_t len,
const char *fmt, ...)
VSMW_Allocf(struct vsmw *vsmw, struct vsmw_cluster *vc,
const char *class, size_t len, const char *fmt, ...)
{
va_list ap;
void *p;
va_start(ap, fmt);
p = VSMW_Allocv(vsmw, class, len, fmt, ap);
p = VSMW_Allocv(vsmw, vc, class, len, fmt, ap);
va_end(ap);
return (p);
}
......
......@@ -37,8 +37,10 @@ struct vsmw_cluster;
struct vsmw_cluster *VSMW_NewCluster(struct vsmw *, size_t , const char *);
void VSMW_DestroyCluster(struct vsmw *, struct vsmw_cluster **);
void *VSMW_Allocv(struct vsmw *, const char *, size_t, const char *, va_list);
void *VSMW_Allocf(struct vsmw *, const char *, size_t, const char *, ...);
void *VSMW_Allocv(struct vsmw *, struct vsmw_cluster *,
const char *, size_t, const char *, va_list);
void *VSMW_Allocf(struct vsmw *, struct vsmw_cluster *,
const char *, size_t, const char *, ...);
void VSMW_Free(struct vsmw *, void **);
struct vsmw *VSMW_New(int, int, const char *);
......
......@@ -58,7 +58,7 @@ mgt_SHM_static_alloc(const void *ptr, ssize_t size,
{
void *p;
p = VSMW_Allocf(mgt_vsmw, class, size, "%s", ident);
p = VSMW_Allocf(mgt_vsmw, NULL, class, size, "%s", ident);
AN(p);
memcpy(p, ptr, size);
}
......@@ -122,13 +122,13 @@ mgt_SHM_ChildNew(void)
MCH_Fd_Inherit(heritage.vsm_fd, "VSMW");
heritage.param = VSMW_Allocf(mgt_vsmw, VSM_CLASS_PARAM,
heritage.param = VSMW_Allocf(mgt_vsmw, NULL, VSM_CLASS_PARAM,
sizeof *heritage.param, "");
AN(heritage.param);
*heritage.param = mgt_param;
heritage.panic_str_len = 64 * 1024;
heritage.panic_str = VSMW_Allocf(mgt_vsmw, "Panic",
heritage.panic_str = VSMW_Allocf(mgt_vsmw, NULL, "Panic",
heritage.panic_str_len, "");
AN(heritage.panic_str);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment