Hello, Do the logical block id-s of a given dnode form a single id space, or are they layered per level? In other words, do all blocks, regardless of their level belong to the same id space 0..n or is each level assigned its own set ob block id-s 0..n? I am guessing it is a single id space per dnode, but I notice many of the block traversal primitives take both the id and the level. Tia for clarifying this, Steve -- This message posted from opensolaris.org
No, blkid=0, level=0 is a different block from blkid=0 level=1. If you draw the tree of blocks, each level will start with blkid 0, then 1, 2, etc. See traverse_visitbp(), the "BP_GET_LEVEL(bp) > 0" section, for more details. --matt On 9/28/10 11:34 AM, Steve Gonczi wrote:> Hello, > > Do the logical block id-s of a given dnode form a single id space, or are they layered per level? > > In other words, do all blocks, regardless of their level belong to the same id space 0..n > or is each level assigned its own set ob block id-s 0..n? > > I am guessing it is a single id space per dnode, but I notice many of the block traversal > primitives take both the id and the level. > > Tia for clarifying this, > > Steve
> Hello, > > Do the logical block id-s of a given dnode form a single id space, or are they layered per level? > > In other words, do all blocks, regardless of their level belong to the same id space 0..n > or is each level assigned its own set ob block id-s 0..n? > > I am guessing it is a single id space per dnode, but I notice many of the block traversal > primitives take both the id and the level. >Logically, from the point of view of a ''client'', when you refer to a block of a dnode, it is a single id space, e.g. dbuf_hold(). However, it is implemented in a tree like structure which gives rise to multiple levels with each level having its own set of ids e.g. dbuf_impl_hold(..., level = 0, blkid)->dbuf_findbp()-> dbuf_hold_impl(...,level=1, blkid >> shift,...) -> ... -- Bhaskar
Thanks for the clarification. What is the meaning /use of dn_maxlbkid in dnode_t, and dnode_phys_t then? Given that the block ids form a separate array for each level, should not there be an array of dn_maxblkid-s (one value for each level)? Steve -- This message posted from opensolaris.org
On 9/28/10 12:34 PM, Steve Gonczi wrote:> Thanks for the clarification. > > What is the meaning /use of dn_maxlbkid in dnode_t, and dnode_phys_t then? > > Given that the block ids form a separate array for each level, > should not there be an array of dn_maxblkid-s (one value for each level)?dn_maxblkid is the highest level-0 blkid that''s been allocated (which is also the highest blkid of any level). The maxblkid''s of other levels can be calculated from that (given indirect block size and sizeof(blkptr_t)). --matt