Use $Restrict

parent 95bcaab7
......@@ -234,13 +234,8 @@ VCL_VOID vmod_buddy_as_transient(VRT_CTX, struct VPFX(slash_stv) *sb)
{
CHECK_OBJ_NOTNULL(sb, SLASH_BUDDY_MAGIC);
if (ctx->method == VCL_MET_INIT) {
sbu_as_transient(sb->storage);
return;
}
VRT_fail(ctx, "%s.as_transient can only be called from vcl_init{}",
sb->name);
assert(ctx->method == VCL_MET_INIT);
sbu_as_transient(sb->storage);
}
VCL_STRING
......@@ -445,13 +440,8 @@ vmod_fellow_as_transient(VRT_CTX, struct VPFX(slash_stv) *sb)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(sb, SLASH_FELLOW_MAGIC);
if (ctx->method == VCL_MET_INIT) {
sfe_as_transient(sb->storage);
return;
}
VRT_fail(ctx, "%s.as_transient can only be called from vcl_init{}",
sb->name);
assert(ctx->method == VCL_MET_INIT);
sfe_as_transient(sb->storage);
}
VCL_VOID
......@@ -459,13 +449,8 @@ vmod_as_transient(VRT_CTX, VCL_STEVEDORE stv)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
if (ctx->method == VCL_MET_INIT) {
sfe_as_transient(TRUST_ME(stv));
return;
}
VRT_fail(ctx,
"slash.as_transient() can only be called from vcl_init{}");
assert(ctx->method == VCL_MET_INIT);
sfe_as_transient(TRUST_ME(stv));
}
VCL_STRING
......
......@@ -388,7 +388,9 @@ VOID xbuddy.as_transient()
Set this buddy storage as the transient storage.
Can only be called from ``vcl_init {}``.
Restricted to: ``vcl_init``.
.. _slash.tune_buddy():
......@@ -761,6 +763,10 @@ VOID xfellow.as_transient()
Set this fellow storage as the transient storage.
Restricted to: ``vcl_init``.
.. _slash.as_transient():
VOID as_transient(STEVEDORE)
......@@ -768,7 +774,9 @@ VOID as_transient(STEVEDORE)
Set this storage as the transient storage.
Can only be called from ``vcl_init {}``.
Restricted to: ``vcl_init``.
.. _slash.tune_fellow():
......
......@@ -355,7 +355,7 @@ $Method VOID .as_transient()
Set this buddy storage as the transient storage.
Can only be called from ``vcl_init {}``.
$Restrict vcl_init
$Function STRING tune_buddy(
STEVEDORE storage,
......@@ -693,11 +693,13 @@ $Method VOID .as_transient()
Set this fellow storage as the transient storage.
$Restrict vcl_init
$Function VOID as_transient(STEVEDORE)
Set this storage as the transient storage.
Can only be called from ``vcl_init {}``.
$Restrict vcl_init
$Function STRING tune_fellow(
STEVEDORE storage,
......
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