diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-02-21 17:04:57 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-02-21 17:04:57 -0500 |
commit | cfaa72952fa7b44aa5d967cbc266110900552aef (patch) | |
tree | 7ca429e7417d168faa57dab4bc069c23fefb5cc4 /fs/btrfs/mkfs.c | |
parent | 06ed4b316e8e24b6899ece7186c6a7a0129326ba (diff) | |
download | kernel-crypto-cfaa72952fa7b44aa5d967cbc266110900552aef.tar.gz kernel-crypto-cfaa72952fa7b44aa5d967cbc266110900552aef.tar.xz kernel-crypto-cfaa72952fa7b44aa5d967cbc266110900552aef.zip |
Btrfs: extent fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/mkfs.c')
-rw-r--r-- | fs/btrfs/mkfs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/mkfs.c b/fs/btrfs/mkfs.c index bab98c6d6fa..584aba44e80 100644 --- a/fs/btrfs/mkfs.c +++ b/fs/btrfs/mkfs.c @@ -18,12 +18,13 @@ int mkfs(int fd) struct extent_item extent_item; int ret; + /* setup the super block area */ memset(info, 0, sizeof(info)); info[0].blocknr = 16; info[0].objectid = 1; info[0].tree_root = 17; info[0].alloc_extent.blocknr = 0; - info[0].alloc_extent.num_blocks = 20; + info[0].alloc_extent.num_blocks = 64; /* 0-17 are used (inclusive) */ info[0].alloc_extent.num_used = 18; @@ -31,12 +32,14 @@ int mkfs(int fd) info[1].objectid = 2; info[1].tree_root = 64; info[1].alloc_extent.blocknr = 64; - info[1].alloc_extent.num_blocks = 8; + info[1].alloc_extent.num_blocks = 64; info[1].alloc_extent.num_used = 1; ret = pwrite(fd, info, sizeof(info), CTREE_SUPER_INFO_OFFSET(CTREE_BLOCKSIZE)); if (ret != sizeof(info)) return -1; + + /* create leaves for the tree root and extent root */ memset(&empty_leaf, 0, sizeof(empty_leaf)); empty_leaf.header.parentid = 1; empty_leaf.header.blocknr = 17; |