Lines Matching full:if
81 if (tx->base_tx == *new_tx_id) { in nobble_tx()
130 if (!n) { in xs_node_unref()
134 if (--n->ref) { in xs_node_unref()
138 if (n->content) { in xs_node_unref()
141 if (n->perms) { in xs_node_unref()
144 if (n->children) { in xs_node_unref()
188 if (name) { in xs_node_create()
211 if (n->name) { in xs_node_copy()
217 if (old->children) { in xs_node_copy()
222 if (old->perms) { in xs_node_copy()
225 if (old->content) { in xs_node_copy()
231 /* Returns true if it made a change to the hash table */
236 if (!child) { in xs_node_add_child()
245 if (!n->children) { in xs_node_add_child()
271 /* The number of nodes which will exist in the tree if this op succeeds. */
278 * replace the root node. If we walk into a shared subtree it
279 * becomes false. If we start *creating* new nodes for a write,
298 if (!op->mutating || op->in_transaction) { in fire_watches()
302 if (parents) { in fire_watches()
308 if (!w) { in fire_watches()
309 /* Fire the parent nodes from 'op' if asked to */ in fire_watches()
326 if (op->dom_id) { in xs_node_add_content()
332 if (data->len > XS_MAX_NODE_SIZE) { in xs_node_add_content()
337 if (!op->inplace) { in xs_node_add_content()
343 if ((*n)->content) { in xs_node_add_content()
347 if (op->tx_id != XBT_NULL) { in xs_node_add_content()
362 if (node_data) { in xs_node_get_content()
377 if (n->ref != 1) { in node_rm_recurse()
385 if (n->children) { in node_rm_recurse()
398 * Actually deleting the child here is just an optimisation; if we in node_rm_recurse()
430 if (old->name) { in xs_node_copy_deleted()
435 if (old->children) { in xs_node_copy_deleted()
441 if (old->perms) { in xs_node_copy_deleted()
445 /* If it gets resurrected we only fire a watch if it lost its content */ in xs_node_copy_deleted()
446 if (old->content) { in xs_node_copy_deleted()
457 if (op->tx_id != XBT_NULL) { in xs_node_rm()
466 if ((*n)->children) { in xs_node_rm()
471 if (this_inplace) { in xs_node_rm()
503 if (dom_id == 0) { in can_access()
515 if (dom_id == perm_dom_id) { in can_access()
526 if (dom_id != perm_dom_id) { in can_access()
539 if (op->dom_id) { in xs_node_set_perms()
544 if (!can_access(op->dom_id, (*n)->perms, "")) { in xs_node_set_perms()
550 if (perm_dom_id != op->dom_id) { in xs_node_set_perms()
554 if (g_list_length(perms) > XS_MAX_PERMS_PER_NODE) { in xs_node_set_perms()
560 if (!op->inplace) { in xs_node_set_perms()
566 if ((*n)->perms) { in xs_node_set_perms()
570 if (op->tx_id != XBT_NULL) { in xs_node_set_perms()
577 * Passed a full reference in *n which it may free if it needs to COW.
581 * refcount of one). If walking down the tree we find a node whose
601 if (op->path[namelen + 1]) { in xs_node_walk()
605 if (slash) { in xs_node_walk()
611 /* If we walk into a subtree which is shared, we must COW */ in xs_node_walk()
612 if (op->mutating && old->ref != 1) { in xs_node_walk()
616 if (!child_name) { in xs_node_walk()
619 if (!can_access(op->dom_id, old->perms, letters)) { in xs_node_walk()
626 if (!err) { in xs_node_walk()
635 if (old && old->children) { in xs_node_walk()
640 if (child) { in xs_node_walk()
641 if (child->deleted_in_tx) { in xs_node_walk()
647 * Now we own it too. But if we can modify inplace, that's going to in xs_node_walk()
652 if (op->mutating && this_inplace) { in xs_node_walk()
656 } else if (op->create_dirs) { in xs_node_walk()
659 if (!can_access(op->dom_id, old->perms, "wb")) { in xs_node_walk()
664 if (op->dom_id && op->new_nr_nodes >= XS_MAX_DOMAIN_NODES) { in xs_node_walk()
673 * If we're creating a new child, we can clearly modify it (and its in xs_node_walk()
683 * If there's a watch on this node, add it to the list to be fired in xs_node_walk()
686 if (watch) { in xs_node_walk()
696 if (watch) { in xs_node_walk()
700 if (err || !op->mutating) { in xs_node_walk()
701 if (stole_child) { in xs_node_walk()
715 if (!this_inplace) { in xs_node_walk()
721 * If we resurrected a deleted_in_tx node, we can mark it as no longer in xs_node_walk()
724 if (op->create_dirs && child && child->deleted_in_tx) { in xs_node_walk()
734 * We bump the parent gencnt if it adds a child that we *didn't* in xs_node_walk()
735 * steal from it in the first place, or if child==NULL and was in xs_node_walk()
739 if ((xs_node_add_child(*n, child_name, child) && !stole_child) || !child) { in xs_node_walk()
745 if (!namelen) { in xs_node_walk()
749 * top, assign the new node count if the operation was successful. If in xs_node_walk()
752 * if it makes a difference. in xs_node_walk()
754 if (!err && op->mutating) { in xs_node_walk()
755 if (!op->in_transaction) { in xs_node_walk()
756 if (op->s->root_tx != op->s->last_tx) { in xs_node_walk()
787 if ((*n)->children) { in xs_node_directory()
791 if (op->op_opaque2) { in xs_node_directory()
803 if (!pathlen || userpath[pathlen] == '/' || strstr(userpath, "//")) { in validate_path()
807 if (!strchr(XS_VALID_CHARS, userpath[i])) { in validate_path()
811 if (userpath[0] == '/') { in validate_path()
812 if (pathlen > XENSTORE_ABS_PATH_MAX) { in validate_path()
817 if (pathlen > XENSTORE_REL_PATH_MAX) { in validate_path()
832 if (ret) { in init_walk_op()
852 if (tx_id == XBT_NULL) { in init_walk_op()
858 if (!tx) { in init_walk_op()
881 if (ret) { in xs_impl_read()
901 if (ret) { in xs_impl_write()
917 * immediately so if you want to change it to (const char *) and keep in xs_impl_directory()
925 if (ret) { in xs_impl_directory()
939 if (*tx_id != XBT_NULL) { in xs_impl_transaction_start()
943 if (dom_id && s->nr_domu_transactions >= XS_MAX_TRANSACTIONS) { in xs_impl_transaction_start()
956 if (dom_id) { in xs_impl_transaction_start()
973 if (n->ref != 1) { in tx_commit_walk()
977 if (n->deleted_in_tx) { in tx_commit_walk()
979 * We fire watches on our parents if we are the *first* node in tx_commit_walk()
994 if (watch) { in tx_commit_walk()
998 if (n->children) { in tx_commit_walk()
1002 if (watch) { in tx_commit_walk()
1007 * Don't fire watches if this node was only copied because a in tx_commit_walk()
1011 if (n->modified_in_tx || n->deleted_in_tx) { in tx_commit_walk()
1027 if (s->root_tx != tx->base_tx) { in transaction_commit()
1040 * If it does, the world is broken. And returning 'ret' would be weird in transaction_commit()
1053 if (s->root->children) { in transaction_commit()
1067 if (!tx || tx->dom_id != dom_id) { in xs_impl_transaction_end()
1071 if (commit) { in xs_impl_transaction_end()
1076 if (dom_id) { in xs_impl_transaction_end()
1091 if (ret) { in xs_impl_rm()
1107 if (ret) { in xs_impl_get_perms()
1122 if (!*valid) { in is_valid_perm()
1126 if (sscanf(perm, "%c%u", &letter, &dom_id) != 2) { in is_valid_perm()
1152 if (!g_list_length(perms)) { in xs_impl_set_perms()
1157 if (!valid) { in xs_impl_set_perms()
1162 if (ret) { in xs_impl_set_perms()
1181 if (ret) { in do_xs_impl_watch()
1188 if (!g_strcmp0(token, w->token) && opaque == w->cb_opaque && in do_xs_impl_watch()
1195 if (dom_id && s->nr_domu_watches >= XS_MAX_WATCHES) { in do_xs_impl_watch()
1207 if (l) { in do_xs_impl_watch()
1213 if (dom_id) { in do_xs_impl_watch()
1225 if (!ret) { in xs_impl_watch()
1237 if (w->dom_id) { in free_watch()
1257 if (ret) { in xs_impl_unwatch()
1262 if (!w) { in xs_impl_unwatch()
1270 * point to the next (or remove it if there's nothing left). in xs_impl_unwatch()
1272 if (!g_strcmp0(token, w->token) && fn == w->cb && opaque == w->cb_opaque && in xs_impl_unwatch()
1274 if (w->next) { in xs_impl_unwatch()
1293 if (!g_strcmp0(token, w->token) && fn == w->cb && in xs_impl_unwatch()
1326 if (w->dom_id == dom_id) { in xs_impl_reset_watches()
1327 /* If we're freeing the head of the list, bump w2 */ in xs_impl_reset_watches()
1328 if (w2 == w) { in xs_impl_reset_watches()
1338 * If the head of the list survived the cull, we don't need to in xs_impl_reset_watches()
1341 if (w1 != w2) { in xs_impl_reset_watches()
1348 * so if we don't give it back to the hash table, we need in xs_impl_reset_watches()
1351 if (w2) { in xs_impl_reset_watches()
1365 if (tx->root) { in xs_tx_free()
1395 if (n->children) { in clear_serialized_tx()
1432 if (name) { in save_node()
1437 * If we already wrote this node, refer to the previous copy. in save_node()
1442 if (n->serialized_tx != XBT_NULL) { in save_node()
1450 if (n->modified_in_tx) { in save_node()
1453 if (n->deleted_in_tx) { in save_node()
1458 if (n->content) { in save_node()
1471 if (n->children) { in save_node()
1504 if (w->dom_id) { in save_watch()
1550 if (s->serialized) { in xs_impl_serialize()
1582 if (us->l < sizeof(d)) { in consume_be32()
1596 if (!us->l) { in consume_string()
1601 if (l == us->l) { in consume_string()
1605 if (str) { in consume_string()
1608 if (len) { in consume_string()
1622 if (path[0] == '\0') { in lookup_node()
1626 if (slash) { in lookup_node()
1630 if (!n->children) { in lookup_node()
1634 if (!slash) { in lookup_node()
1639 if (!child) { in lookup_node()
1648 if (tx_id == us->s->root_tx) { in lookup_tx_node()
1653 if (!t) { in lookup_tx_node()
1667 if (n->children) { in count_child_nodes()
1679 if (us->l < 1) { in consume_node()
1686 if (flags == NODE_REF) { in consume_node()
1690 if (ret) { in consume_node()
1695 if (!n) { in consume_node()
1699 if (n->children) { in consume_node()
1705 if (flags & ~(DELETED_IN_TX | MODIFIED_IN_TX)) { in consume_node()
1710 if (flags & DELETED_IN_TX) { in consume_node()
1713 if (flags & MODIFIED_IN_TX) { in consume_node()
1717 if (ret) { in consume_node()
1721 if (datalen) { in consume_node()
1722 if (datalen > us->l) { in consume_node()
1733 if (us->root_walk) { in consume_node()
1742 if (ret) { in consume_node()
1747 if (!permlen) { in consume_node()
1762 if (ret) { in consume_node()
1767 if (!childlen) { in consume_node()
1777 if (ret) { in consume_node()
1786 * If the node has no data and no children we still want to fire in consume_node()
1789 if (us->root_walk && !n->children) { in consume_node()
1794 if (!n->deleted_in_tx) { in consume_node()
1807 if (ret) { in consume_tree()
1811 if (t->tx_id > us->s->last_tx) { in consume_tree()
1841 if (ret) { in xs_impl_deserialize()
1855 if (ret) { in xs_impl_deserialize()
1871 if (ret) { in xs_impl_deserialize()
1880 if (ret) { in xs_impl_deserialize()
1883 if (base_tx == XBT_NULL) { in xs_impl_deserialize()
1891 if (!ret) { in xs_impl_deserialize()
1894 if (ret) { in xs_impl_deserialize()
1899 if (t->dom_id) { in xs_impl_deserialize()
1910 if (ret) { in xs_impl_deserialize()
1913 if (!pathlen) { in xs_impl_deserialize()
1918 if (ret) { in xs_impl_deserialize()
1922 if (!watch_fn) { in xs_impl_deserialize()
1927 if (ret) { in xs_impl_deserialize()
1932 if (us.l) { in xs_impl_deserialize()