Lines Matching full:tag
98 static inline void tag_set(struct radix_tree_node *node, unsigned int tag, in tag_set() argument
101 __set_bit(offset, node->tags[tag]); in tag_set()
104 static inline void tag_clear(struct radix_tree_node *node, unsigned int tag, in tag_clear() argument
107 __clear_bit(offset, node->tags[tag]); in tag_clear()
110 static inline int tag_get(const struct radix_tree_node *node, unsigned int tag, in tag_get() argument
113 return test_bit(offset, node->tags[tag]); in tag_get()
116 static inline void root_tag_set(struct radix_tree_root *root, unsigned tag) in root_tag_set() argument
118 root->xa_flags |= (__force gfp_t)(1 << (tag + ROOT_TAG_SHIFT)); in root_tag_set()
121 static inline void root_tag_clear(struct radix_tree_root *root, unsigned tag) in root_tag_clear() argument
123 root->xa_flags &= (__force gfp_t)~(1 << (tag + ROOT_TAG_SHIFT)); in root_tag_clear()
131 static inline int root_tag_get(const struct radix_tree_root *root, unsigned tag) in root_tag_get() argument
133 return (__force int)root->xa_flags & (1 << (tag + ROOT_TAG_SHIFT)); in root_tag_get()
147 * Returns 1 if any slot in the node has this tag set.
151 unsigned int tag) in any_tag_set() argument
155 if (node->tags[tag][idx]) in any_tag_set()
161 static inline void all_tag_set(struct radix_tree_node *node, unsigned int tag) in all_tag_set() argument
163 bitmap_fill(node->tags[tag], RADIX_TREE_MAP_SIZE); in all_tag_set()
170 * @tag: the tag index
178 radix_tree_find_next_bit(struct radix_tree_node *node, unsigned int tag, in radix_tree_find_next_bit() argument
181 const unsigned long *addr = node->tags[tag]; in radix_tree_find_next_bit()
411 int tag; in radix_tree_extend() local
435 /* Propagate the aggregated tag info to the new child */ in radix_tree_extend()
436 for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) { in radix_tree_extend()
437 if (root_tag_get(root, tag)) in radix_tree_extend()
438 tag_set(node, tag, 0); in radix_tree_extend()
525 * also results in a stale slot). So tag the slot as indirect in radix_tree_shrink()
834 unsigned int tag, unsigned int offset) in node_tag_get() argument
837 return tag_get(node, tag, offset); in node_tag_get()
838 return root_tag_get(root, tag); in node_tag_get()
938 unsigned int tag, unsigned int offset) in node_tag_set() argument
941 if (tag_get(node, tag, offset)) in node_tag_set()
943 tag_set(node, tag, offset); in node_tag_set()
948 if (!root_tag_get(root, tag)) in node_tag_set()
949 root_tag_set(root, tag); in node_tag_set()
953 * radix_tree_tag_set - set a tag on a radix tree node
956 * @tag: tag index
958 * Set the search tag (which must be < RADIX_TREE_MAX_TAGS)
962 * Returns the address of the tagged item. Setting a tag on a not-present
966 unsigned long index, unsigned int tag) in radix_tree_tag_set() argument
981 if (!tag_get(parent, tag, offset)) in radix_tree_tag_set()
982 tag_set(parent, tag, offset); in radix_tree_tag_set()
985 /* set the root's tag bit */ in radix_tree_tag_set()
986 if (!root_tag_get(root, tag)) in radix_tree_tag_set()
987 root_tag_set(root, tag); in radix_tree_tag_set()
995 unsigned int tag, unsigned int offset) in node_tag_clear() argument
998 if (!tag_get(node, tag, offset)) in node_tag_clear()
1000 tag_clear(node, tag, offset); in node_tag_clear()
1001 if (any_tag_set(node, tag)) in node_tag_clear()
1008 /* clear the root's tag bit */ in node_tag_clear()
1009 if (root_tag_get(root, tag)) in node_tag_clear()
1010 root_tag_clear(root, tag); in node_tag_clear()
1014 * radix_tree_tag_clear - clear a tag on a radix tree node
1017 * @tag: tag index
1019 * Clear the search tag (which must be < RADIX_TREE_MAX_TAGS)
1021 * the leaf node to have no tags set then clear the tag in the
1028 unsigned long index, unsigned int tag) in radix_tree_tag_clear() argument
1046 node_tag_clear(root, parent, tag, offset); in radix_tree_tag_clear()
1053 * radix_tree_iter_tag_clear - clear a tag on the current iterator entry
1056 * @tag: tag to clear
1059 const struct radix_tree_iter *iter, unsigned int tag) in radix_tree_iter_tag_clear() argument
1061 node_tag_clear(root, iter->node, tag, iter_offset(iter)); in radix_tree_iter_tag_clear()
1065 * radix_tree_tag_get - get a tag on a radix tree node
1068 * @tag: tag index (< RADIX_TREE_MAX_TAGS)
1072 * 0: tag not present or not set
1073 * 1: tag set
1076 * the RCU lock is held, unless tag modification and node deletion are excluded
1080 unsigned long index, unsigned int tag) in radix_tree_tag_get() argument
1085 if (!root_tag_get(root, tag)) in radix_tree_tag_get()
1098 if (!tag_get(parent, tag, offset)) in radix_tree_tag_get()
1108 /* Construct iter->tags bit-mask from node->tags[tag] array */
1111 unsigned tag) in set_iter_tags() argument
1121 iter->tags = node->tags[tag][tag_long] >> tag_bit; in set_iter_tags()
1127 iter->tags |= node->tags[tag][tag_long + 1] << in set_iter_tags()
1150 * @flags: RADIX_TREE_ITER_* flags and tag index
1156 unsigned tag = flags & RADIX_TREE_ITER_TAG_MASK; in radix_tree_next_chunk() local
1160 if ((flags & RADIX_TREE_ITER_TAGGED) && !root_tag_get(root, tag)) in radix_tree_next_chunk()
1197 !tag_get(node, tag, offset) : !child) { in radix_tree_next_chunk()
1203 offset = radix_tree_find_next_bit(node, tag, in radix_tree_next_chunk()
1234 set_iter_tags(iter, node, offset, tag); in radix_tree_next_chunk()
1289 * based on a tag
1294 * @tag: the tag index (< RADIX_TREE_MAX_TAGS)
1297 * have the tag indexed by @tag set. Places the items at *@results and
1303 unsigned int tag) in radix_tree_gang_lookup_tag() argument
1312 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) { in radix_tree_gang_lookup_tag()
1330 * radix tree based on a tag
1335 * @tag: the tag index (< RADIX_TREE_MAX_TAGS)
1338 * have the tag indexed by @tag set. Places the slots at *@results and
1344 unsigned int max_items, unsigned int tag) in radix_tree_gang_lookup_tag_slot() argument
1353 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) { in radix_tree_gang_lookup_tag_slot()
1369 int tag; in __radix_tree_delete() local
1374 for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) in __radix_tree_delete()
1375 node_tag_clear(root, node, tag, offset); in __radix_tree_delete()
1453 * @tag: tag to test
1455 int radix_tree_tagged(const struct radix_tree_root *root, unsigned int tag) in radix_tree_tagged() argument
1457 return root_tag_get(root, tag); in radix_tree_tagged()