Commit Graph

23 Commits

Author SHA1 Message Date
Zach Brown
56077b61a1 Move to btree blocks
Update mkfs and printing for the btree experiment.

Signed-off-by: Zach Brown <zab@versity.com>
2016-04-12 19:33:32 -07:00
Zach Brown
c4fcf40097 Update ring manifest deletion entries
The ring now contains stores full manifest entries that are deleted
rather than just their block number.

Signed-off-by: Zach Brown <zab@versity.com>
2016-04-02 20:30:45 -04:00
Zach Brown
544fd1ba9a Add ctrstat command
Like vmstat and iostat, this prints out our counters over time.

Signed-off-by: Zach Brown <zab@versity.com>
2016-04-01 00:04:26 -04:00
Zach Brown
af2975111a Update format for smaller bloom
Update our format for the smaller bloom sizes.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-29 13:10:45 -04:00
Zach Brown
7ea78502c8 Read both super blocks and use current
When printing try to read both super blocks and use the most recent one
instead of just using the first one.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-29 13:07:00 -04:00
Zach Brown
10cf83ffc5 Update key type value format change
Adding file data items changed the item key values.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-26 14:00:19 -04:00
Zach Brown
339c719e4e Print dirents in print command
Add support for printing dirent items to scoutfs print.  We're careful
to change non-printable characters to ".".

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-25 00:24:48 -04:00
Zach Brown
e1c1c50ead Update to multiple dirent hash format
Update print to show the inode fields in the newer dirent hashing
scheme.  mkfs doesn't create directory entries.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-24 21:09:51 -07:00
Zach Brown
e0e6179156 Fix bloom filter bugs
The bloom filter had two bad bugs.

First the calculation was adding the bit width of newly hashed data to
the hash value instead of the record of the hashed bits available.

And the block offset calculation for each bit wasn't truncated to the
number of bloom blocks.  While fixing this we can clean up the code and
make it faster by recording the bits in terms of their block and bit
offset instead of their large bit value.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 22:23:21 -04:00
Zach Brown
ddf5ef1017 Fix set_bit_le() type width problems
The swizzle value was defined in terms of longs but the code used u64s.
And the bare shifted value was an int so it'd get truncated.  Switch it
all to using longs.

The ratio of bugs to lines of code in that first attempt was through the
roof!

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 22:21:11 -04:00
Zach Brown
502783e1bc Update to segment format with skiplists and bloom
Update to the format rev which has large log segments that start with
bloom filter blocks, have items linked in a skip list, and item values
stored at offsets in the block.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 15:23:54 -07:00
Zach Brown
463f5e5a07 Correctly store last random word
pseudo_random_bytes() was accidentally copying the last partial long to
the beggining of the buffer instead of the end.  The final partial long
bytes weren't being filled.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 15:16:58 -07:00
Zach Brown
d0429e1c88 Add minimal bloom filter helpers
mkfs just needs to initialize bloom filter blocks with the bits for the
single root inode key.  We can get away with these skeletal functions
for now.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 14:01:16 -07:00
Zach Brown
8471134328 Add trivial set_bit_le in bitops.h
We're going to need to start setting bloom filters bits in mkfs so we'll
add this trivial inline.  It might grow later.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 14:00:07 -07:00
Zach Brown
f3de3b1817 Add DIV_ROUND_UP() to util.h
We're going to need this in some upcoming format.h changes.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-23 13:58:59 -07:00
Zach Brown
a0a3ef9675 Mark all mkfs chunks allocated in bitmap
The initial bitmap entry written in the ring by mkfs was off by one.
Three chunks were written but the 0th chunk is also free for the supers.
It has to mark the first four chunks as allocated.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-17 17:05:24 -07:00
Zach Brown
e59d0af199 Print full map and ring blocks
In the first pass we'd only printed the first map and ring blocks.

This reads the number of used map blocks into an allocation large enough
for the maximum number of map blocks.

Then we use the block numbers from the map blocks to print the active
ring blocks which are described by the super.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-17 17:05:19 -07:00
Zach Brown
d8f76cb893 Minor ring manifest format updates
Update to the format changes that were made while implementing ring
replay in the kernel.
2016-02-25 22:45:06 -08:00
Zach Brown
906c0186bc Get path size with stat or ioctl
If we're making a file system in a real device then we need to get
the device size with an ioctl.
2016-02-25 22:40:48 -08:00
Zach Brown
e9baa4559b Introduce chunk and segment terminology
The use of 'log' for all the large sizes was pretty confusing.  Let's
use 'chunk' to describe the large alloc size.  Other things live in them
as well as logs.  Then use 'log segment' to describe the larger log
structure stored in a chunk that's made up of all the little blocks.
2016-02-23 17:04:28 -08:00
Zach Brown
de1bf39614 Get rid of bricks
Get rid of the explicit distinction between brick and block numbers.
The format is now defined it terms of fixed 4k blocks.  Logs become a
logical structure that's made up of a fixed number of blocks.  The
allocator still manages large log sized regions.
2016-02-19 15:40:04 -08:00
Zach Brown
a7b8f955fe write ring brick as brick in mkfs
The only ring brick was being written as a full block which made its
brick checksum cover the entire block instead of just the brick.
2016-02-19 08:53:14 -08:00
Zach Brown
2c2f090168 Initial commit
This initial commit has enough to make a new file system and print out
it's structures.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-12 15:58:41 -08:00