From b72ddf64bc5d89487ffe9672f0ba89c5b90ac2e5 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Thu, 22 Apr 2010 13:34:17 -0700 Subject: 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. --- src/common/unionfs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/common/unionfs.c') 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)); -- cgit v1.2.3