2 Feb 07:36
Rough draft of atomic commit for userspace
Daniel Phillips <phillips <at> phunq.net>
2009-02-02 06:36:27 GMT
2009-02-02 06:36:27 GMT
It compiles, it has not been tried. There are probably mistakes and
omissions.
There are two new lists in the superblock:
sb->pinned ... dirty btree nodes and bitmap blocks written per rollup
sb->commit ... dirty blocks written per delta
This code implements a periodic rollup flush, which mainly moves blocks
from the pinned list to the commit list, and a delta flush, which
writes out the dirty metadata, then writes out the log blocks.
diff -r 4d5b59994ae7 user/buffer.c
--- a/user/buffer.c Wed Jan 28 21:19:05 2009 -0800
+++ b/user/buffer.c Sun Feb 01 22:33:25 2009 -0800
@@ -299,7 +299,7 @@ struct buffer_head *blockread(map_t *map
return buffer;
}
-int blockdirty(struct buffer_head *buffer, unsigned newdelta)
+int blockdirty(struct buffer_head *buffer, unsigned newdelta, struct list_head *forked)
{
unsigned oldstate = buffer->state;
assert(oldstate < BUFFER_STATES);
@@ -316,7 +316,7 @@ int blockdirty(struct buffer_head *buffe
buffer->data = clone->data;
clone->data = data;
clone->index = buffer->index;
- set_buffer_state(clone, oldstate);
+ set_buffer_state_list(clone, oldstate, forked);
(Continue reading)
RSS Feed