BEFS_BTREE_READ
Section: (9)
Updated: 09 October 2005
Index
Return to Main Contents
NAME
befs_btree_read - Traverse leafnodes of a btree
SYNOPSIS
"SYNOPSIS"
int befs_btree_read (struct super_block * sb, befs_data_stream * ds, loff_t key_no, size_t bufsize, char * keybuf, size_t * keysize, befs_off_t * value);
ARGUMENTS
- sb
-
Filesystem superblock
- ds
-
Datastream containing btree
- key_no
-
Key number (alphabetical order) of key to read
- bufsize
-
Size of the buffer to return key in
- keybuf
-
Pointer to a buffer to put the key in
- keysize
-
Length of the returned key
- value
-
Value stored with the returned key
HERES HOW IT WORKS
Key_no is the index of the key/value pair to
return in keybuf/value.
Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
the number of charecters in the key (just a convenience).
ALGORITHM
Get the first leafnode of the tree. See if the requested key is in that
node. If not, follow the node->right link to the next leafnode. Repeat
until the (key_no)th key is found or the tree is out of keys.
Index
- NAME
-
- SYNOPSIS
-
- ARGUMENTS
-
- HERES HOW IT WORKS
-
- ALGORITHM
-
This document was created by
man2html,
using the manual pages.
Time: 00:01:58 GMT, October 09, 2005