shapor / tux3 (http://shapor.com/tux3)

Tux3 is a write-anywhere, atomic commit, btree-based versioning filesystem. It is the spiritual and moral successor of Tux2, the most famous filesystem that was never released. The main purpose of Tux3 is to embody Daniel Phillips's new ideas on storage data versioning. The secondary goal is to provide a more efficient snapshotting and replication method for the Zumastor NAS project, and a tertiary goal is to be better than ZFS.

Clone this repository (size: 1.3 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/shapor/tux3/
commit 945: 85d4c98904b9
parent 944: 990650a52020
branch: default
Move errio() to buffer.c I think errio() is common handler like dev_blockio().
OGAWA Hirofumi
14 months ago

Changed (Δ272 bytes):

raw changeset »

user/btree.c (1 lines added, 6 lines removed)

user/buffer.c (6 lines added, 0 lines removed)

user/buffer.h (1 lines added, 0 lines removed)

user/commit.c (1 lines added, 6 lines removed)

Up to file-list user/btree.c:

@@ -158,17 +158,12 @@ static void tree_expand_test(struct curs
158
158
	release_cursor(cursor);
159
159
}
160
160
161
int errio(struct buffer_head *buffer, int write)
162
{
163
	return -EINVAL;
164
}
165
166
161
int main(int argc, char *argv[])
167
162
{
168
163
	struct dev *dev = &(struct dev){ .bits = 6 };
169
164
	struct sb *sb = &(struct sb){ INIT_SB(dev), };
170
165
	sb->volmap = rapid_open_inode(sb, NULL, 0);
171
	sb->logmap = rapid_open_inode(sb, errio, 0);
166
	sb->logmap = rapid_open_inode(sb, dev_errio, 0);
172
167
	init_buffers(dev, 1 << 20, 0);
173
168
	sb->entries_per_node = (sb->blocksize - offsetof(struct bnode, entries)) / sizeof(struct index_entry);
174
169
	printf("entries_per_node = %i\n", sb->entries_per_node);

Up to file-list user/buffer.c:

@@ -501,6 +501,12 @@ int dev_blockio(struct buffer_head *buff
501
501
	return err;
502
502
}
503
503
504
int dev_errio(struct buffer_head *buffer, int write)
505
{
506
	assert(0);
507
	return -EIO;
508
}
509
504
510
map_t *new_map(struct dev *dev, blockio_t *io)
505
511
{
506
512
	map_t *map = malloc(sizeof(*map)); // error???

Up to file-list user/buffer.h:

@@ -103,6 +103,7 @@ static inline int buffer_dirty(struct bu
103
103
	return buffer->state >= BUFFER_DIRTY;
104
104
}
105
105
106
int dev_errio(struct buffer_head *buffer, int write);
106
107
map_t *new_map(struct dev *dev, blockio_t *io);
107
108
void free_map(map_t *map);
108
109
#endif

Up to file-list user/commit.c:

@@ -125,11 +125,6 @@ int bitmap_io(struct buffer_head *buffer
125
125
	return (write) ? write_bitmap(buffer) : filemap_extent_io(buffer, 0);
126
126
}
127
127
128
int errio(struct buffer_head *buffer, int write)
129
{
130
	return -EINVAL;
131
}
132
133
128
int main(int argc, char *argv[])
134
129
{
135
130
	if (argc < 2)
@@ -147,7 +142,7 @@ int main(int argc, char *argv[])
147
142
		.volblocks = volsize >> dev->bits,
148
143
	};
149
144
	sb->volmap = rapid_open_inode(sb, NULL, 0);
150
	sb->logmap = rapid_open_inode(sb, errio, 0);
145
	sb->logmap = rapid_open_inode(sb, dev_errio, 0);
151
146
	assert(!make_tux3(sb));
152
147
	sb->bitmap->map->io = bitmap_io;
153
148
	if (0) {