diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:15 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:59 -0400 |
commit | 07f9479a40cc778bc1462ada11f95b01360ae4ff (patch) | |
tree | 0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /fs/btrfs/ctree.h | |
parent | 9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff) | |
parent | cd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff) |
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 7f78cc78fdd0..2e61fe1b6b8c 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/kobject.h> | 30 | #include <linux/kobject.h> |
31 | #include <trace/events/btrfs.h> | ||
31 | #include <asm/kmap_types.h> | 32 | #include <asm/kmap_types.h> |
32 | #include "extent_io.h" | 33 | #include "extent_io.h" |
33 | #include "extent_map.h" | 34 | #include "extent_map.h" |
@@ -40,6 +41,7 @@ extern struct kmem_cache *btrfs_trans_handle_cachep; | |||
40 | extern struct kmem_cache *btrfs_transaction_cachep; | 41 | extern struct kmem_cache *btrfs_transaction_cachep; |
41 | extern struct kmem_cache *btrfs_bit_radix_cachep; | 42 | extern struct kmem_cache *btrfs_bit_radix_cachep; |
42 | extern struct kmem_cache *btrfs_path_cachep; | 43 | extern struct kmem_cache *btrfs_path_cachep; |
44 | extern struct kmem_cache *btrfs_free_space_cachep; | ||
43 | struct btrfs_ordered_sum; | 45 | struct btrfs_ordered_sum; |
44 | 46 | ||
45 | #define BTRFS_MAGIC "_BHRfS_M" | 47 | #define BTRFS_MAGIC "_BHRfS_M" |
@@ -738,8 +740,10 @@ struct btrfs_space_info { | |||
738 | */ | 740 | */ |
739 | unsigned long reservation_progress; | 741 | unsigned long reservation_progress; |
740 | 742 | ||
741 | int full; /* indicates that we cannot allocate any more | 743 | int full:1; /* indicates that we cannot allocate any more |
742 | chunks for this space */ | 744 | chunks for this space */ |
745 | int chunk_alloc:1; /* set if we are allocating a chunk */ | ||
746 | |||
743 | int force_alloc; /* set if we need to force a chunk alloc for | 747 | int force_alloc; /* set if we need to force a chunk alloc for |
744 | this space */ | 748 | this space */ |
745 | 749 | ||
@@ -782,9 +786,6 @@ struct btrfs_free_cluster { | |||
782 | /* first extent starting offset */ | 786 | /* first extent starting offset */ |
783 | u64 window_start; | 787 | u64 window_start; |
784 | 788 | ||
785 | /* if this cluster simply points at a bitmap in the block group */ | ||
786 | bool points_to_bitmap; | ||
787 | |||
788 | struct btrfs_block_group_cache *block_group; | 789 | struct btrfs_block_group_cache *block_group; |
789 | /* | 790 | /* |
790 | * when a cluster is allocated from a block group, we put the | 791 | * when a cluster is allocated from a block group, we put the |
@@ -1283,6 +1284,9 @@ struct btrfs_root { | |||
1283 | #define BTRFS_INODE_NODUMP (1 << 8) | 1284 | #define BTRFS_INODE_NODUMP (1 << 8) |
1284 | #define BTRFS_INODE_NOATIME (1 << 9) | 1285 | #define BTRFS_INODE_NOATIME (1 << 9) |
1285 | #define BTRFS_INODE_DIRSYNC (1 << 10) | 1286 | #define BTRFS_INODE_DIRSYNC (1 << 10) |
1287 | #define BTRFS_INODE_COMPRESS (1 << 11) | ||
1288 | |||
1289 | #define BTRFS_INODE_ROOT_ITEM_INIT (1 << 31) | ||
1286 | 1290 | ||
1287 | /* some macros to generate set/get funcs for the struct fields. This | 1291 | /* some macros to generate set/get funcs for the struct fields. This |
1288 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple | 1292 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple |
@@ -2157,6 +2161,8 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, | |||
2157 | u64 root_objectid, u64 owner, u64 offset); | 2161 | u64 root_objectid, u64 owner, u64 offset); |
2158 | 2162 | ||
2159 | int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); | 2163 | int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); |
2164 | int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, | ||
2165 | u64 num_bytes, int reserve, int sinfo); | ||
2160 | int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans, | 2166 | int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans, |
2161 | struct btrfs_root *root); | 2167 | struct btrfs_root *root); |
2162 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, | 2168 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, |
@@ -2227,10 +2233,12 @@ u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo); | |||
2227 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, | 2233 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, |
2228 | u64 start, u64 end); | 2234 | u64 start, u64 end); |
2229 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, | 2235 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, |
2230 | u64 num_bytes); | 2236 | u64 num_bytes, u64 *actual_bytes); |
2231 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, | 2237 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, |
2232 | struct btrfs_root *root, u64 type); | 2238 | struct btrfs_root *root, u64 type); |
2239 | int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range); | ||
2233 | 2240 | ||
2241 | int btrfs_init_space_info(struct btrfs_fs_info *fs_info); | ||
2234 | /* ctree.c */ | 2242 | /* ctree.c */ |
2235 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, | 2243 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, |
2236 | int level, int *slot); | 2244 | int level, int *slot); |
@@ -2355,6 +2363,8 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); | |||
2355 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root); | 2363 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root); |
2356 | int btrfs_set_root_node(struct btrfs_root_item *item, | 2364 | int btrfs_set_root_node(struct btrfs_root_item *item, |
2357 | struct extent_buffer *node); | 2365 | struct extent_buffer *node); |
2366 | void btrfs_check_and_init_root_item(struct btrfs_root_item *item); | ||
2367 | |||
2358 | /* dir-item.c */ | 2368 | /* dir-item.c */ |
2359 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, | 2369 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, |
2360 | struct btrfs_root *root, const char *name, | 2370 | struct btrfs_root *root, const char *name, |
@@ -2392,6 +2402,9 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans, | |||
2392 | struct btrfs_path *path, u64 dir, | 2402 | struct btrfs_path *path, u64 dir, |
2393 | const char *name, u16 name_len, | 2403 | const char *name, u16 name_len, |
2394 | int mod); | 2404 | int mod); |
2405 | int verify_dir_item(struct btrfs_root *root, | ||
2406 | struct extent_buffer *leaf, | ||
2407 | struct btrfs_dir_item *dir_item); | ||
2395 | 2408 | ||
2396 | /* orphan.c */ | 2409 | /* orphan.c */ |
2397 | int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, | 2410 | int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, |
@@ -2528,7 +2541,7 @@ int btrfs_update_inode(struct btrfs_trans_handle *trans, | |||
2528 | struct inode *inode); | 2541 | struct inode *inode); |
2529 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); | 2542 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); |
2530 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); | 2543 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); |
2531 | void btrfs_orphan_cleanup(struct btrfs_root *root); | 2544 | int btrfs_orphan_cleanup(struct btrfs_root *root); |
2532 | void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, | 2545 | void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, |
2533 | struct btrfs_pending_snapshot *pending, | 2546 | struct btrfs_pending_snapshot *pending, |
2534 | u64 *bytes_to_reserve); | 2547 | u64 *bytes_to_reserve); |
@@ -2536,7 +2549,7 @@ void btrfs_orphan_post_snapshot(struct btrfs_trans_handle *trans, | |||
2536 | struct btrfs_pending_snapshot *pending); | 2549 | struct btrfs_pending_snapshot *pending); |
2537 | void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, | 2550 | void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, |
2538 | struct btrfs_root *root); | 2551 | struct btrfs_root *root); |
2539 | int btrfs_cont_expand(struct inode *inode, loff_t size); | 2552 | int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size); |
2540 | int btrfs_invalidate_inodes(struct btrfs_root *root); | 2553 | int btrfs_invalidate_inodes(struct btrfs_root *root); |
2541 | void btrfs_add_delayed_iput(struct inode *inode); | 2554 | void btrfs_add_delayed_iput(struct inode *inode); |
2542 | void btrfs_run_delayed_iputs(struct btrfs_root *root); | 2555 | void btrfs_run_delayed_iputs(struct btrfs_root *root); |
@@ -2565,6 +2578,11 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, | |||
2565 | int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, | 2578 | int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, |
2566 | struct inode *inode, u64 start, u64 end); | 2579 | struct inode *inode, u64 start, u64 end); |
2567 | int btrfs_release_file(struct inode *inode, struct file *file); | 2580 | int btrfs_release_file(struct inode *inode, struct file *file); |
2581 | void btrfs_drop_pages(struct page **pages, size_t num_pages); | ||
2582 | int btrfs_dirty_pages(struct btrfs_root *root, struct inode *inode, | ||
2583 | struct page **pages, size_t num_pages, | ||
2584 | loff_t pos, size_t write_bytes, | ||
2585 | struct extent_state **cached); | ||
2568 | 2586 | ||
2569 | /* tree-defrag.c */ | 2587 | /* tree-defrag.c */ |
2570 | int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, | 2588 | int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, |