summaryrefslogtreecommitdiff
path: root/src/common/unionfs.c
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-04-22 13:34:17 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-04-22 13:34:17 -0700
commitb72ddf64bc5d89487ffe9672f0ba89c5b90ac2e5 (patch)
tree23b4f9af8dfd915c8951729fd3bb0dbf9e658fb7 /src/common/unionfs.c
parentd29097a8800e16899873bea1b70b85b0bd3586ab (diff)
downloadvyatta-cfg-b72ddf64bc5d89487ffe9672f0ba89c5b90ac2e5.tar.gz
vyatta-cfg-b72ddf64bc5d89487ffe9672f0ba89c5b90ac2e5.zip
support for PARENT reference in priority statements. Example:
priority: PARENT Means that this priority group will adopt the priority value of the parent. And the behavior on deletion of this priority root node will be deleted before the parent. On all other operations this node will be scheduled after the parent. This should fix problems in scheduling creation/deletion orders for priority groups so long as they are located within the same hierarchy. priority.pl has been updated as well.
Diffstat (limited to 'src/common/unionfs.c')
-rw-r--r--src/common/unionfs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index 2220d73..2be210e 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -154,7 +154,7 @@ void
retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
{
boolean final_node = FALSE;
-
+
if (node == NULL) {
return;
}
@@ -223,6 +223,7 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
printf("[FOUND node.def]");
syslog(LOG_DEBUG,"[FOUND node.def]");
}
+
//either multi or tag--shouldn't have made a difference, but arkady was confused.
vn->_config._multi = (def.tag | def.multi);
if (def.def_tag > 0) {
@@ -278,11 +279,11 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
}
}
-
if (G_NODE_IS_ROOT(node) == FALSE) {
struct VyattaNode* vn_parent = (struct VyattaNode*)node->parent->data;
struct VyattaNode* vn = (struct VyattaNode*)node->data;
// vn->_config._priority = vn_parent->_config._def.def_priority;
+
if (vn->_config._def.tag && vn->_config._multi) {
vn->_config._priority = LOWEST_PRIORITY;
}
@@ -292,6 +293,13 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
else {
vn->_config._priority = vn->_config._def.def_priority;
}
+
+ if (vn->_config._def.tag && vn->_config._multi) {
+ vn->_config._priority_extended = '\0';
+ }
+ else {
+ vn->_config._priority_extended = vn->_config._def.def_priority_ext;
+ }
}
@@ -896,6 +904,7 @@ copy_vyatta_node(struct VyattaNode* vn)
new_vn->_data._operation = vn->_data._operation;
new_vn->_config._multi = vn->_config._multi;
new_vn->_config._priority = vn->_config._priority;
+ new_vn->_config._priority_extended = vn->_config._priority_extended;
// new_vn->_config._def = new_vn->_config._def; //cpy this?
if (vn->_config._default != NULL) {
new_vn->_config._default = malloc(MAX_LENGTH_DIR_PATH*sizeof(char));