Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: assoc_array: Format internal tree layout tables

Format tables in "Basic internal tree layout" as reST tables.

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20251013095630.34235-4-bagasdotme@gmail.com>

authored by

Bagas Sanjaya and committed by
Jonathan Corbet
22605d25 54ff675c

+21 -12
+21 -12
Documentation/core-api/assoc_array.rst
··· 317 317 modified, provided the RCU read lock is held. 318 318 319 319 The function will return the object if found (and set ``*_type`` to the 320 - object 321 - type) or will return ``NULL`` if the object was not found. 320 + object type) or will return ``NULL`` if the object was not found. 322 321 323 322 324 323 Index Key Form ··· 399 400 400 401 In the above example, there are 7 nodes (A-G), each with 16 slots (0-f). 401 402 Assuming no other meta data nodes in the tree, the key space is divided 402 - thusly:: 403 + thusly: 403 404 405 + =========== ==== 404 406 KEY PREFIX NODE 405 - ========== ==== 407 + =========== ==== 406 408 137* D 407 409 138* E 408 410 13[0-69-f]* C ··· 411 411 e6* G 412 412 e[0-57-f]* F 413 413 [02-df]* A 414 + =========== ==== 414 415 415 416 So, for instance, keys with the following example index keys will be found in 416 - the appropriate nodes:: 417 + the appropriate nodes: 417 418 419 + =============== ======= ==== 418 420 INDEX KEY PREFIX NODE 419 421 =============== ======= ==== 420 422 13694892892489 13 C ··· 425 423 138bbb89003093 138 E 426 424 1394879524789 12 C 427 425 1458952489 1 B 428 - 9431809de993ba - A 429 - b4542910809cd - A 426 + 9431809de993ba \- A 427 + b4542910809cd \- A 430 428 e5284310def98 e F 431 429 e68428974237 e6 G 432 430 e7fffcbd443 e F 433 - f3842239082 - A 431 + f3842239082 \- A 432 + =============== ======= ==== 434 433 435 434 To save memory, if a node can hold all the leaves in its portion of keyspace, 436 435 then the node will have all those leaves in it and will not have any metadata ··· 445 442 the metadata key prefix must be in the subtree that the metadata pointer points 446 443 to. 447 444 448 - In the above example list of index keys, node A will contain:: 445 + In the above example list of index keys, node A will contain: 449 446 447 + ==== =============== ================== 450 448 SLOT CONTENT INDEX KEY (PREFIX) 451 449 ==== =============== ================== 452 450 1 PTR TO NODE B 1* ··· 455 451 any LEAF b4542910809cd 456 452 e PTR TO NODE F e* 457 453 any LEAF f3842239082 454 + ==== =============== ================== 458 455 459 - and node B:: 456 + and node B: 460 457 461 - 3 PTR TO NODE C 13* 462 - any LEAF 1458952489 458 + ==== =============== ================== 459 + SLOT CONTENT INDEX KEY (PREFIX) 460 + ==== =============== ================== 461 + 3 PTR TO NODE C 13* 462 + any LEAF 1458952489 463 + ==== =============== ================== 463 464 464 465 465 466 Shortcuts