このページを編集する際は、編集に関する方針に従ってください。

概要

引数

実装

/**

*	radix_tree_tag_clear - clear a tag on a radix tree node
*	@root:		radix tree root
*	@index:		index key
*	@tag: 		tag index
*
*	Clear the search tag corresponging to @index in the radix tree.  If
*	this causes the leaf node to have no tags set then clear the tag in the
*	next-to-leaf node, etc.
*
*	Returns the address of the tagged item on success, else NULL.  ie:
*	has the same return value and semantics as radix_tree_lookup().
*/

void *radix_tree_tag_clear(struct radix_tree_root *root,

			unsigned long index, int tag)

{

	struct radix_tree_path path[RADIX_TREE_MAX_PATH], *pathp = path;
    • radix_tree_path/linux2.6?を参照
	unsigned int height, shift;
	void *ret = NULL;
	height = root->height;
	if (index > radix_tree_maxindex(height))
		goto out;
	shift = (height - 1) * RADIX_TREE_MAP_SHIFT;
	pathp->node = NULL;
	pathp->slot = &root->rnode;
	while (height > 0) {
		int offset;
		if (*pathp->slot == NULL)
			goto out;
		offset = (index >> shift) & RADIX_TREE_MAP_MASK;
		pathp[1].offset = offset;
		pathp[1].node = *pathp[0].slot;
		pathp[1].slot = (struct radix_tree_node **)
				(pathp[1].node->slots + offset);
		pathp++;
		shift -= RADIX_TREE_MAP_SHIFT;
		height--;
	}
	ret = *pathp[0].slot;
	if (ret == NULL)
		goto out;
	do {
		int idx;
		tag_clear(pathp[0].node, tag, pathp[0].offset);
		for (idx = 0; idx < RADIX_TREE_TAG_LONGS; idx++) {
			if (pathp[0].node->tags[tag][idx])
				goto out;
		}
		pathp--;
	} while (pathp[0].node);

out:

	return ret;

}

EXPORT_SYMBOL(radix_tree_tag_clear);

呼出元


履歴

  • 作者:ひら
  • 日付:2005/11/28
  • 対象:2.6.10
    更新日更新者更新内容

コメント



トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2009-11-24 (火) 07:17:32 (3129d)