[Tux3] Prototype of btree node redirect
Daniel Phillips
phillips at phunq.net
Tue Jan 13 04:05:30 PST 2009
Sorry about the long lines in the previous post...
On Tuesday 13 January 2009 01:51, I wrote:
> Here is a prototype of block redirect for btree nodes. It has not
> been tested at all, it just compiles (patch attached). It has one
> severe deficiency: it can't handle redirecting the root of a btree
> because the btree cursor does not know where the btree root is cached.
>
> To place this in conext, redirect on write comes in two distinctly
> different flavors:
>
> Redirect a data extent in file page cache:
> - Logically mapped
> - no need to relocate data blocks in cache
> - just need to update pointer in parent (dleaf)
> - Handled by map_region
>
> Redirect a btree node in volume cache:
> - Physically mapped
> - need to move data to a new buffer and release old
> - Handled various functions in btree.c
>
> In either case, we are releasing some data blocks and allocating new
> ones, because the contents of cache has changed and we need to place it
> on disk without overwriting any part of the existing, stable filesystem
> image.
OK, we know what we are going to do with redirect of root: instead of
passing (btree *) to btree functions, we will pass (inode *), which has
the btree root. For the special case of the inode table root, the
inode passed will be our volume map, our buffer cache replacement.
Redirecting the root will set the cached inode dirty, and delta staging
will flush all dirty inodes to disk (store_attrs). As a later
optimization we can log a promise to update the disk inode, and only
flush inodes at rollup intervals.
Regards,
Daniel
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3
More information about the Tux3
mailing list