summaryrefslogtreecommitdiff
path: root/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-10-16 10:36:55 -0400
committerChris Mason <chris.mason@fusionio.com>2013-10-16 10:42:53 -0400
commitd1570a06184ed3748536a67693ef5cfd954d4032 (patch)
tree3fe610614ddc64a510006820a518297d14a9dec1 /ctree.h
parent005d7d2efb0aaaae056584f3cbd25d3bfce73ea3 (diff)
downloadbtrfs-progs-d1570a06184ed3748536a67693ef5cfd954d4032.tar.gz
mkfs: fix mkfs -r to properly allocate space
mkfs -r wasn't creating chunks properly, making it very difficult to allocate space for anything except tiny filesystems. This changes it around to use more of the generic infrastructure, and to do actual logical->physical block number translation. It also allocates space to the files in smaller extents (max 1MB), which keeps the allocator from trying to allocate an extent bigger than a single chunk. It doesn't quite support multi-device mkfs -r yet, but is much closer. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'ctree.h')
-rw-r--r--ctree.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index 8ca3e76..2117374 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2124,6 +2124,11 @@ static inline int btrfs_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag)
btrfs_item_offset_nr(leaf, slot)))
/* extent-tree.c */
+int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ u64 num_bytes, u64 empty_size,
+ u64 hint_byte, u64 search_end,
+ struct btrfs_key *ins, int data);
int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
struct btrfs_root *root);
void btrfs_pin_extent(struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes);
@@ -2191,6 +2196,11 @@ int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
int btrfs_update_block_group(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 bytenr, u64 num,
int alloc, int mark_free);
+int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 objectid,
+ struct btrfs_inode_item *inode,
+ u64 file_pos, u64 disk_bytenr,
+ u64 num_bytes);
/* ctree.c */
int btrfs_del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct btrfs_path *path, int level, int slot);