• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/lib/

Lines Matching defs:tag

100 static inline void tag_set(struct radix_tree_node *node, unsigned int tag,
103 __set_bit(offset, node->tags[tag]);
106 static inline void tag_clear(struct radix_tree_node *node, unsigned int tag,
109 __clear_bit(offset, node->tags[tag]);
112 static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
115 return test_bit(offset, node->tags[tag]);
118 static inline void root_tag_set(struct radix_tree_root *root, unsigned int tag)
120 root->gfp_mask |= (__force gfp_t)(1 << (tag + __GFP_BITS_SHIFT));
123 static inline void root_tag_clear(struct radix_tree_root *root, unsigned int tag)
125 root->gfp_mask &= (__force gfp_t)~(1 << (tag + __GFP_BITS_SHIFT));
133 static inline int root_tag_get(struct radix_tree_root *root, unsigned int tag)
135 return (__force unsigned)root->gfp_mask & (1 << (tag + __GFP_BITS_SHIFT));
139 * Returns 1 if any slot in the node has this tag set.
142 static inline int any_tag_set(struct radix_tree_node *node, unsigned int tag)
146 if (node->tags[tag][idx])
260 int tag;
280 /* Propagate the aggregated tag info into the new root */
281 for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) {
282 if (root_tag_get(root, tag))
283 tag_set(node, tag, 0);
446 * radix_tree_tag_set - set a tag on a radix tree node
449 * @tag: tag index
451 * Set the search tag (which must be < RADIX_TREE_MAX_TAGS)
455 * Returns the address of the tagged item. Setting a tag on a not-present
459 unsigned long index, unsigned int tag)
474 if (!tag_get(slot, tag, offset))
475 tag_set(slot, tag, offset);
482 /* set the root's tag bit */
483 if (slot && !root_tag_get(root, tag))
484 root_tag_set(root, tag);
491 * radix_tree_tag_clear - clear a tag on a radix tree node
494 * @tag: tag index
496 * Clear the search tag (which must be < RADIX_TREE_MAX_TAGS)
498 * this causes the leaf node to have no tags set then clear the tag in the
505 unsigned long index, unsigned int tag)
542 if (!tag_get(pathp->node, tag, pathp->offset))
544 tag_clear(pathp->node, tag, pathp->offset);
545 if (any_tag_set(pathp->node, tag))
550 /* clear the root's tag bit */
551 if (root_tag_get(root, tag))
552 root_tag_clear(root, tag);
560 * radix_tree_tag_get - get a tag on a radix tree node
563 * @tag: tag index (< RADIX_TREE_MAX_TAGS)
567 * 0: tag not present or not set
568 * 1: tag set
571 * the RCU lock is held, unless tag modification and node deletion are excluded
575 unsigned long index, unsigned int tag)
581 /* check the root's tag bit */
582 if (!root_tag_get(root, tag))
609 * we see an unset tag.
611 if (!tag_get(node, tag, offset))
614 return !!tag_get(node, tag, offset);
624 * tag if item has another tag set
628 * @nr_to_tag: maximum number items to tag
629 * @iftag: tag index to test
630 * @settag: tag index to set if tested tag is set
642 * can lead to problems with later tag operations (e.g. livelocks on lookups).
644 * The function returns number of leaves where the tag was set and sets
705 /* tag the leaf */
712 /* stop if we find a node with the tag already set */
1003 unsigned int max_items, unsigned long *next_index, unsigned int tag)
1017 if (tag_get(slot, tag, i))
1033 if (!tag_get(slot, tag, j))
1036 * Even though the tag was found set, we need to
1064 * based on a tag
1069 * @tag: the tag index (< RADIX_TREE_MAX_TAGS)
1072 * have the tag indexed by @tag set. Places the items at *@results and
1078 unsigned int tag)
1085 /* check the root's tag bit */
1086 if (!root_tag_get(root, tag))
1111 cur_index, max_items - ret, &next_index, tag);
1134 * radix tree based on a tag
1139 * @tag: the tag index (< RADIX_TREE_MAX_TAGS)
1142 * have the tag indexed by @tag set. Places the slots at *@results and
1148 unsigned int tag)
1155 /* check the root's tag bit */
1156 if (!root_tag_get(root, tag))
1181 cur_index, max_items - ret, &next_index, tag);
1244 * also results in a stale slot). So tag the slot as indirect
1274 int tag;
1311 for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) {
1312 if (tag_get(pathp->node, tag, pathp->offset))
1313 radix_tree_tag_clear(root, index, tag);
1353 * @tag: tag to test
1355 int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag)
1357 return root_tag_get(root, tag);