diff options
Diffstat (limited to 'fs/ocfs2/alloc.h')
| -rw-r--r-- | fs/ocfs2/alloc.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h index fbcb5934a081..990df48ae8d3 100644 --- a/fs/ocfs2/alloc.h +++ b/fs/ocfs2/alloc.h | |||
| @@ -34,7 +34,17 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, | |||
| 34 | u32 cpos, | 34 | u32 cpos, |
| 35 | u64 start_blk, | 35 | u64 start_blk, |
| 36 | u32 new_clusters, | 36 | u32 new_clusters, |
| 37 | u8 flags, | ||
| 37 | struct ocfs2_alloc_context *meta_ac); | 38 | struct ocfs2_alloc_context *meta_ac); |
| 39 | struct ocfs2_cached_dealloc_ctxt; | ||
| 40 | int ocfs2_mark_extent_written(struct inode *inode, struct buffer_head *di_bh, | ||
| 41 | handle_t *handle, u32 cpos, u32 len, u32 phys, | ||
| 42 | struct ocfs2_alloc_context *meta_ac, | ||
| 43 | struct ocfs2_cached_dealloc_ctxt *dealloc); | ||
| 44 | int ocfs2_remove_extent(struct inode *inode, struct buffer_head *di_bh, | ||
| 45 | u32 cpos, u32 len, handle_t *handle, | ||
| 46 | struct ocfs2_alloc_context *meta_ac, | ||
| 47 | struct ocfs2_cached_dealloc_ctxt *dealloc); | ||
| 38 | int ocfs2_num_free_extents(struct ocfs2_super *osb, | 48 | int ocfs2_num_free_extents(struct ocfs2_super *osb, |
| 39 | struct inode *inode, | 49 | struct inode *inode, |
| 40 | struct ocfs2_dinode *fe); | 50 | struct ocfs2_dinode *fe); |
| @@ -62,17 +72,41 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb, | |||
| 62 | struct ocfs2_dinode **tl_copy); | 72 | struct ocfs2_dinode **tl_copy); |
| 63 | int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, | 73 | int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb, |
| 64 | struct ocfs2_dinode *tl_copy); | 74 | struct ocfs2_dinode *tl_copy); |
| 75 | int ocfs2_truncate_log_needs_flush(struct ocfs2_super *osb); | ||
| 76 | int ocfs2_truncate_log_append(struct ocfs2_super *osb, | ||
| 77 | handle_t *handle, | ||
| 78 | u64 start_blk, | ||
| 79 | unsigned int num_clusters); | ||
| 80 | int __ocfs2_flush_truncate_log(struct ocfs2_super *osb); | ||
| 81 | |||
| 82 | /* | ||
| 83 | * Process local structure which describes the block unlinks done | ||
| 84 | * during an operation. This is populated via | ||
| 85 | * ocfs2_cache_block_dealloc(). | ||
| 86 | * | ||
| 87 | * ocfs2_run_deallocs() should be called after the potentially | ||
| 88 | * de-allocating routines. No journal handles should be open, and most | ||
| 89 | * locks should have been dropped. | ||
| 90 | */ | ||
| 91 | struct ocfs2_cached_dealloc_ctxt { | ||
| 92 | struct ocfs2_per_slot_free_list *c_first_suballocator; | ||
| 93 | }; | ||
| 94 | static inline void ocfs2_init_dealloc_ctxt(struct ocfs2_cached_dealloc_ctxt *c) | ||
| 95 | { | ||
| 96 | c->c_first_suballocator = NULL; | ||
| 97 | } | ||
| 98 | int ocfs2_run_deallocs(struct ocfs2_super *osb, | ||
| 99 | struct ocfs2_cached_dealloc_ctxt *ctxt); | ||
| 65 | 100 | ||
| 66 | struct ocfs2_truncate_context { | 101 | struct ocfs2_truncate_context { |
| 67 | struct inode *tc_ext_alloc_inode; | 102 | struct ocfs2_cached_dealloc_ctxt tc_dealloc; |
| 68 | struct buffer_head *tc_ext_alloc_bh; | ||
| 69 | int tc_ext_alloc_locked; /* is it cluster locked? */ | 103 | int tc_ext_alloc_locked; /* is it cluster locked? */ |
| 70 | /* these get destroyed once it's passed to ocfs2_commit_truncate. */ | 104 | /* these get destroyed once it's passed to ocfs2_commit_truncate. */ |
| 71 | struct buffer_head *tc_last_eb_bh; | 105 | struct buffer_head *tc_last_eb_bh; |
| 72 | }; | 106 | }; |
| 73 | 107 | ||
| 74 | int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle, | 108 | int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle, |
| 75 | u64 new_i_size); | 109 | u64 range_start, u64 range_end); |
| 76 | int ocfs2_prepare_truncate(struct ocfs2_super *osb, | 110 | int ocfs2_prepare_truncate(struct ocfs2_super *osb, |
| 77 | struct inode *inode, | 111 | struct inode *inode, |
| 78 | struct buffer_head *fe_bh, | 112 | struct buffer_head *fe_bh, |
| @@ -84,6 +118,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb, | |||
| 84 | 118 | ||
| 85 | int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el, | 119 | int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el, |
| 86 | u32 cpos, struct buffer_head **leaf_bh); | 120 | u32 cpos, struct buffer_head **leaf_bh); |
| 121 | int ocfs2_search_extent_list(struct ocfs2_extent_list *el, u32 v_cluster); | ||
| 87 | 122 | ||
| 88 | /* | 123 | /* |
| 89 | * Helper function to look at the # of clusters in an extent record. | 124 | * Helper function to look at the # of clusters in an extent record. |
