From a5e5ddbbc35fca7a33e2c14d7e4b2e068e01da51 Mon Sep 17 00:00:00 2001 From: slioch Date: Wed, 21 Oct 2009 17:27:55 -0700 Subject: priorities should match up on all nodes now, except where the priority file diverges from the node.defs commit behavior has not changed yet, but can be completely switched over to node.def priority system with simple change. --- src/common/unionfs.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/common/unionfs.c b/src/common/unionfs.c index 8f7341a..d5f9d3f 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -231,7 +231,13 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op) } //either multi or tag--shouldn't have made a difference, but arkady was confused. vn->_config._multi = (def.tag | def.multi); - vn->_config._priority = def.def_priority; + if (def.def_priority == 0) { + vn->_config._priority = LOWEST_PRIORITY; + } + else { + vn->_config._priority = def.def_priority; + } + } } @@ -248,6 +254,16 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op) if (vn_parent->_config._multi == TRUE) { ((struct VyattaNode*)node->data)->_data._value = TRUE; + //patch up to preserve multinode behavior on value node, can also put node.def on node.tag with priority + //Need to do two things: + // 1. Come to agreement on where the behavior splits on priority multinodes + // 2. Not check for tag node in the def datastructure but use the new datastructure as at some point tag and multi will be the same + if (vn_parent->_config._def.tag == TRUE) { //only for embedded multinodes + vn->_config._priority = vn_parent->_config._priority; + vn_parent->_config._priority = LOWEST_PRIORITY; + } + + //now let's patch up the def multi-nodes //move the def for the multinode from the parent to the value node struct VyattaNode* vn2 = (struct VyattaNode*)node->data; -- cgit v1.2.3