[Tux3] [PATHC 1/4] commit cleanup/fix
OGAWA Hirofumi
hirofumi at mail.parknet.co.jp
Mon Mar 9 18:30:14 PDT 2009
diff -puN user/commit.c~commit-fix user/commit.c
--- tux3/user/commit.c~commit-fix 2009-03-10 09:58:19.000000000 +0900
+++ tux3-hirofumi/user/commit.c 2009-03-10 09:58:19.000000000 +0900
@@ -109,12 +109,10 @@ int main(int argc, char *argv[])
sb->entries_per_node = (sb->blocksize - sizeof(struct bnode)) / sizeof(struct index_entry);
sb->volmap = rapid_open_inode(sb, NULL, 0);
sb->logmap = rapid_open_inode(sb, dev_errio, 0);
- INIT_LIST_HEAD(&sb->commit);
- INIT_LIST_HEAD(&sb->pinned);
assert(!make_tux3(sb));
sb->bitmap->map->io = bitmap_io;
if (1) {
- sb->super = (struct disksuper){ .magic = SB_MAGIC, .volblocks = to_be_u64(sb->blockbits) };
+ sb->super = (struct disksuper){ .magic = SB_MAGIC, .volblocks = to_be_u64(sb->volblocks) };
for (int i = 0; i < 29; i++) {
struct tux_iattr iattr = { .mode = S_IFREG | S_IRWXU };
char name[100];
diff -puN user/filemap.c~commit-fix user/filemap.c
--- tux3/user/filemap.c~commit-fix 2009-03-10 09:58:19.000000000 +0900
+++ tux3-hirofumi/user/filemap.c 2009-03-10 09:58:19.000000000 +0900
@@ -399,7 +399,7 @@ int write_bitmap(struct buffer_head *buf
if (err < 0)
return err;
assert(err == 1);
- assert(buffer->state - BUFFER_DIRTY == ((sb->delta - 1) & (BUFFER_DIRTY_STATES - 1)));
+ assert(buffer->state - BUFFER_DIRTY == ((sb->flush - 1) & (BUFFER_DIRTY_STATES - 1)));
trace("write bitmap %Lx", (L)buffer->index);
if (!(err = diskwrite(sb->dev->fd, buffer->data, sb->blocksize, seg.block << sb->blockbits)))
clean_buffer(buffer);
diff -puN user/kernel/commit.c~commit-fix user/kernel/commit.c
--- tux3/user/kernel/commit.c~commit-fix 2009-03-10 09:58:19.000000000 +0900
+++ tux3-hirofumi/user/kernel/commit.c 2009-03-10 09:58:19.000000000 +0900
@@ -161,8 +161,6 @@ static int stage_delta(struct sb *sb)
}
#endif
- sb->delta++;
-
/* allocate and write log blocks */
if (sb->logbuf)
diff -puN user/tux3.h~commit-fix user/tux3.h
--- tux3/user/tux3.h~commit-fix 2009-03-10 09:58:19.000000000 +0900
+++ tux3-hirofumi/user/tux3.h 2009-03-10 09:58:19.000000000 +0900
@@ -243,7 +243,9 @@ static inline dev_t huge_decode_dev(u64
.blockmask = ((1 << (dev)->bits) - 1), \
.delta_lock = __RWSEM_INITIALIZER, \
.loglock = __MUTEX_INITIALIZER, \
- .dirty_inodes = LIST_HEAD_INIT((sb).dirty_inodes)
+ .dirty_inodes = LIST_HEAD_INIT((sb).dirty_inodes), \
+ .commit = LIST_HEAD_INIT((sb).commit), \
+ .pinned = LIST_HEAD_INIT((sb).pinned)
#define rapid_open_inode(sb, io, mode, init_defs...) ({ \
struct inode *__inode = &(struct inode){}; \
_
--
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3
More information about the Tux3
mailing list