Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
alloc.h File Reference

Go to the source code of this file.

Data Structures

struct  ocfs2_extent_tree
 
struct  ocfs2_cached_dealloc_ctxt
 
struct  ocfs2_truncate_context
 
struct  ocfs2_path_item
 
struct  ocfs2_path
 

Macros

#define OCFS2_MAX_XATTR_TREE_LEAF_SIZE   65536
 
#define OCFS2_MAX_PATH_DEPTH   5
 
#define path_root_bh(_path)   ((_path)->p_node[0].bh)
 
#define path_root_el(_path)   ((_path)->p_node[0].el)
 
#define path_root_access(_path)   ((_path)->p_root_access)
 
#define path_leaf_bh(_path)   ((_path)->p_node[(_path)->p_tree_depth].bh)
 
#define path_leaf_el(_path)   ((_path)->p_node[(_path)->p_tree_depth].el)
 
#define path_num_items(_path)   ((_path)->p_tree_depth + 1)
 

Enumerations

enum  ocfs2_alloc_restarted { RESTART_NONE = 0, RESTART_TRANS, RESTART_META }
 

Functions

void ocfs2_init_dinode_extent_tree (struct ocfs2_extent_tree *et, struct ocfs2_caching_info *ci, struct buffer_head *bh)
 
void ocfs2_init_xattr_tree_extent_tree (struct ocfs2_extent_tree *et, struct ocfs2_caching_info *ci, struct buffer_head *bh)
 
void ocfs2_init_xattr_value_extent_tree (struct ocfs2_extent_tree *et, struct ocfs2_caching_info *ci, struct ocfs2_xattr_value_buf *vb)
 
void ocfs2_init_dx_root_extent_tree (struct ocfs2_extent_tree *et, struct ocfs2_caching_info *ci, struct buffer_head *bh)
 
void ocfs2_init_refcount_extent_tree (struct ocfs2_extent_tree *et, struct ocfs2_caching_info *ci, struct buffer_head *bh)
 
int ocfs2_read_extent_block (struct ocfs2_caching_info *ci, u64 eb_blkno, struct buffer_head **bh)
 
int ocfs2_insert_extent (handle_t *handle, struct ocfs2_extent_tree *et, u32 cpos, u64 start_blk, u32 new_clusters, u8 flags, struct ocfs2_alloc_context *meta_ac)
 
int ocfs2_add_clusters_in_btree (handle_t *handle, struct ocfs2_extent_tree *et, u32 *logical_offset, u32 clusters_to_add, int mark_unwritten, struct ocfs2_alloc_context *data_ac, struct ocfs2_alloc_context *meta_ac, enum ocfs2_alloc_restarted *reason_ret)
 
int ocfs2_split_extent (handle_t *handle, struct ocfs2_extent_tree *et, struct ocfs2_path *path, int split_index, struct ocfs2_extent_rec *split_rec, struct ocfs2_alloc_context *meta_ac, struct ocfs2_cached_dealloc_ctxt *dealloc)
 
int ocfs2_mark_extent_written (struct inode *inode, struct ocfs2_extent_tree *et, handle_t *handle, u32 cpos, u32 len, u32 phys, struct ocfs2_alloc_context *meta_ac, struct ocfs2_cached_dealloc_ctxt *dealloc)
 
int ocfs2_change_extent_flag (handle_t *handle, struct ocfs2_extent_tree *et, u32 cpos, u32 len, u32 phys, struct ocfs2_alloc_context *meta_ac, struct ocfs2_cached_dealloc_ctxt *dealloc, int new_flags, int clear_flags)
 
int ocfs2_remove_extent (handle_t *handle, struct ocfs2_extent_tree *et, u32 cpos, u32 len, struct ocfs2_alloc_context *meta_ac, struct ocfs2_cached_dealloc_ctxt *dealloc)
 
int ocfs2_remove_btree_range (struct inode *inode, struct ocfs2_extent_tree *et, u32 cpos, u32 phys_cpos, u32 len, int flags, struct ocfs2_cached_dealloc_ctxt *dealloc, u64 refcount_loc)
 
int ocfs2_num_free_extents (struct ocfs2_super *osb, struct ocfs2_extent_tree *et)
 
void ocfs2_dinode_new_extent_list (struct inode *inode, struct ocfs2_dinode *di)
 
void ocfs2_set_inode_data_inline (struct inode *inode, struct ocfs2_dinode *di)
 
int ocfs2_convert_inline_data_to_extents (struct inode *inode, struct buffer_head *di_bh)
 
int ocfs2_truncate_log_init (struct ocfs2_super *osb)
 
void ocfs2_truncate_log_shutdown (struct ocfs2_super *osb)
 
void ocfs2_schedule_truncate_log_flush (struct ocfs2_super *osb, int cancel)
 
int ocfs2_flush_truncate_log (struct ocfs2_super *osb)
 
int ocfs2_begin_truncate_log_recovery (struct ocfs2_super *osb, int slot_num, struct ocfs2_dinode **tl_copy)
 
int ocfs2_complete_truncate_log_recovery (struct ocfs2_super *osb, struct ocfs2_dinode *tl_copy)
 
int ocfs2_truncate_log_needs_flush (struct ocfs2_super *osb)
 
int ocfs2_truncate_log_append (struct ocfs2_super *osb, handle_t *handle, u64 start_blk, unsigned int num_clusters)
 
int __ocfs2_flush_truncate_log (struct ocfs2_super *osb)
 
int ocfs2_cache_cluster_dealloc (struct ocfs2_cached_dealloc_ctxt *ctxt, u64 blkno, unsigned int bit)
 
int ocfs2_cache_block_dealloc (struct ocfs2_cached_dealloc_ctxt *ctxt, int type, int slot, u64 suballoc, u64 blkno, unsigned int bit)
 
int ocfs2_run_deallocs (struct ocfs2_super *osb, struct ocfs2_cached_dealloc_ctxt *ctxt)
 
int ocfs2_zero_range_for_truncate (struct inode *inode, handle_t *handle, u64 range_start, u64 range_end)
 
int ocfs2_commit_truncate (struct ocfs2_super *osb, struct inode *inode, struct buffer_head *di_bh)
 
int ocfs2_truncate_inline (struct inode *inode, struct buffer_head *di_bh, unsigned int start, unsigned int end, int trunc)
 
int ocfs2_find_leaf (struct ocfs2_caching_info *ci, struct ocfs2_extent_list *root_el, u32 cpos, struct buffer_head **leaf_bh)
 
int ocfs2_search_extent_list (struct ocfs2_extent_list *el, u32 v_cluster)
 
int ocfs2_trim_fs (struct super_block *sb, struct fstrim_range *range)
 
int ocfs2_grab_pages (struct inode *inode, loff_t start, loff_t end, struct page **pages, int *num)
 
void ocfs2_map_and_dirty_page (struct inode *inode, handle_t *handle, unsigned int from, unsigned int to, struct page *page, int zero, u64 *phys)
 
void ocfs2_reinit_path (struct ocfs2_path *path, int keep_root)
 
void ocfs2_free_path (struct ocfs2_path *path)
 
int ocfs2_find_path (struct ocfs2_caching_info *ci, struct ocfs2_path *path, u32 cpos)
 
struct ocfs2_pathocfs2_new_path_from_path (struct ocfs2_path *path)
 
struct ocfs2_pathocfs2_new_path_from_et (struct ocfs2_extent_tree *et)
 
int ocfs2_path_bh_journal_access (handle_t *handle, struct ocfs2_caching_info *ci, struct ocfs2_path *path, int idx)
 
int ocfs2_journal_access_path (struct ocfs2_caching_info *ci, handle_t *handle, struct ocfs2_path *path)
 
int ocfs2_find_cpos_for_right_leaf (struct super_block *sb, struct ocfs2_path *path, u32 *cpos)
 
int ocfs2_find_cpos_for_left_leaf (struct super_block *sb, struct ocfs2_path *path, u32 *cpos)
 
int ocfs2_find_subtree_root (struct ocfs2_extent_tree *et, struct ocfs2_path *left, struct ocfs2_path *right)
 

Macro Definition Documentation

#define OCFS2_MAX_PATH_DEPTH   5

Definition at line 288 of file alloc.h.

#define OCFS2_MAX_XATTR_TREE_LEAF_SIZE   65536

Definition at line 33 of file alloc.h.

#define path_leaf_bh (   _path)    ((_path)->p_node[(_path)->p_tree_depth].bh)

Definition at line 299 of file alloc.h.

#define path_leaf_el (   _path)    ((_path)->p_node[(_path)->p_tree_depth].el)

Definition at line 300 of file alloc.h.

#define path_num_items (   _path)    ((_path)->p_tree_depth + 1)

Definition at line 301 of file alloc.h.

#define path_root_access (   _path)    ((_path)->p_root_access)

Definition at line 298 of file alloc.h.

#define path_root_bh (   _path)    ((_path)->p_node[0].bh)

Definition at line 296 of file alloc.h.

#define path_root_el (   _path)    ((_path)->p_node[0].el)

Definition at line 297 of file alloc.h.

Enumeration Type Documentation

Enumerator:
RESTART_NONE 
RESTART_TRANS 
RESTART_META 

Definition at line 104 of file alloc.h.

Function Documentation

int __ocfs2_flush_truncate_log ( struct ocfs2_super osb)

Definition at line 5928 of file alloc.c.

int ocfs2_add_clusters_in_btree ( handle_t *  handle,
struct ocfs2_extent_tree et,
u32 logical_offset,
u32  clusters_to_add,
int  mark_unwritten,
struct ocfs2_alloc_context data_ac,
struct ocfs2_alloc_context meta_ac,
enum ocfs2_alloc_restarted reason_ret 
)

Definition at line 4735 of file alloc.c.

int ocfs2_begin_truncate_log_recovery ( struct ocfs2_super osb,
int  slot_num,
struct ocfs2_dinode **  tl_copy 
)

Definition at line 6078 of file alloc.c.

int ocfs2_cache_block_dealloc ( struct ocfs2_cached_dealloc_ctxt ctxt,
int  type,
int  slot,
u64  suballoc,
u64  blkno,
unsigned int  bit 
)

Definition at line 6509 of file alloc.c.

int ocfs2_cache_cluster_dealloc ( struct ocfs2_cached_dealloc_ctxt ctxt,
u64  blkno,
unsigned int  bit 
)

Definition at line 6365 of file alloc.c.

int ocfs2_change_extent_flag ( handle_t *  handle,
struct ocfs2_extent_tree et,
u32  cpos,
u32  len,
u32  phys,
struct ocfs2_alloc_context meta_ac,
struct ocfs2_cached_dealloc_ctxt dealloc,
int  new_flags,
int  clear_flags 
)

Definition at line 5092 of file alloc.c.

int ocfs2_commit_truncate ( struct ocfs2_super osb,
struct inode inode,
struct buffer_head *  di_bh 
)

Definition at line 6963 of file alloc.c.

int ocfs2_complete_truncate_log_recovery ( struct ocfs2_super osb,
struct ocfs2_dinode tl_copy 
)

Definition at line 6146 of file alloc.c.

int ocfs2_convert_inline_data_to_extents ( struct inode inode,
struct buffer_head *  di_bh 
)

Definition at line 6805 of file alloc.c.

void ocfs2_dinode_new_extent_list ( struct inode inode,
struct ocfs2_dinode di 
)

Definition at line 6775 of file alloc.c.

int ocfs2_find_cpos_for_left_leaf ( struct super_block sb,
struct ocfs2_path path,
u32 cpos 
)

Definition at line 2205 of file alloc.c.

int ocfs2_find_cpos_for_right_leaf ( struct super_block sb,
struct ocfs2_path path,
u32 cpos 
)

Definition at line 2820 of file alloc.c.

int ocfs2_find_leaf ( struct ocfs2_caching_info ci,
struct ocfs2_extent_list root_el,
u32  cpos,
struct buffer_head **  leaf_bh 
)

Definition at line 1917 of file alloc.c.

int ocfs2_find_path ( struct ocfs2_caching_info ci,
struct ocfs2_path path,
u32  cpos 
)

Definition at line 1885 of file alloc.c.

int ocfs2_find_subtree_root ( struct ocfs2_extent_tree et,
struct ocfs2_path left,
struct ocfs2_path right 
)

Definition at line 1737 of file alloc.c.

int ocfs2_flush_truncate_log ( struct ocfs2_super osb)

Definition at line 6002 of file alloc.c.

void ocfs2_free_path ( struct ocfs2_path path)

Definition at line 609 of file alloc.c.

int ocfs2_grab_pages ( struct inode inode,
loff_t  start,
loff_t  end,
struct page **  pages,
int num 
)

Definition at line 6634 of file alloc.c.

void ocfs2_init_dinode_extent_tree ( struct ocfs2_extent_tree et,
struct ocfs2_caching_info ci,
struct buffer_head *  bh 
)

Definition at line 458 of file alloc.c.

void ocfs2_init_dx_root_extent_tree ( struct ocfs2_extent_tree et,
struct ocfs2_caching_info ci,
struct buffer_head *  bh 
)

Definition at line 482 of file alloc.c.

void ocfs2_init_refcount_extent_tree ( struct ocfs2_extent_tree et,
struct ocfs2_caching_info ci,
struct buffer_head *  bh 
)

Definition at line 490 of file alloc.c.

void ocfs2_init_xattr_tree_extent_tree ( struct ocfs2_extent_tree et,
struct ocfs2_caching_info ci,
struct buffer_head *  bh 
)

Definition at line 466 of file alloc.c.

void ocfs2_init_xattr_value_extent_tree ( struct ocfs2_extent_tree et,
struct ocfs2_caching_info ci,
struct ocfs2_xattr_value_buf vb 
)

Definition at line 474 of file alloc.c.

int ocfs2_insert_extent ( handle_t *  handle,
struct ocfs2_extent_tree et,
u32  cpos,
u64  start_blk,
u32  new_clusters,
u8  flags,
struct ocfs2_alloc_context meta_ac 
)

Definition at line 4665 of file alloc.c.

int ocfs2_journal_access_path ( struct ocfs2_caching_info ci,
handle_t *  handle,
struct ocfs2_path path 
)

Definition at line 746 of file alloc.c.

void ocfs2_map_and_dirty_page ( struct inode inode,
handle_t *  handle,
unsigned int  from,
unsigned int  to,
struct page page,
int  zero,
u64 phys 
)

Definition at line 6564 of file alloc.c.

int ocfs2_mark_extent_written ( struct inode inode,
struct ocfs2_extent_tree et,
handle_t *  handle,
u32  cpos,
u32  len,
u32  phys,
struct ocfs2_alloc_context meta_ac,
struct ocfs2_cached_dealloc_ctxt dealloc 
)

Definition at line 5181 of file alloc.c.

struct ocfs2_path* ocfs2_new_path_from_et ( struct ocfs2_extent_tree et)
read

Definition at line 713 of file alloc.c.

struct ocfs2_path* ocfs2_new_path_from_path ( struct ocfs2_path path)
read

Definition at line 707 of file alloc.c.

int ocfs2_num_free_extents ( struct ocfs2_super osb,
struct ocfs2_extent_tree et 
)

Definition at line 959 of file alloc.c.

int ocfs2_path_bh_journal_access ( handle_t *  handle,
struct ocfs2_caching_info ci,
struct ocfs2_path path,
int  idx 
)

Definition at line 726 of file alloc.c.

int ocfs2_read_extent_block ( struct ocfs2_caching_info ci,
u64  eb_blkno,
struct buffer_head **  bh 
)

Definition at line 939 of file alloc.c.

void ocfs2_reinit_path ( struct ocfs2_path path,
int  keep_root 
)

Definition at line 580 of file alloc.c.

int ocfs2_remove_btree_range ( struct inode inode,
struct ocfs2_extent_tree et,
u32  cpos,
u32  phys_cpos,
u32  len,
int  flags,
struct ocfs2_cached_dealloc_ctxt dealloc,
u64  refcount_loc 
)

Definition at line 5636 of file alloc.c.

int ocfs2_remove_extent ( handle_t *  handle,
struct ocfs2_extent_tree et,
u32  cpos,
u32  len,
struct ocfs2_alloc_context meta_ac,
struct ocfs2_cached_dealloc_ctxt dealloc 
)

Definition at line 5445 of file alloc.c.

int ocfs2_run_deallocs ( struct ocfs2_super osb,
struct ocfs2_cached_dealloc_ctxt ctxt 
)

Definition at line 6440 of file alloc.c.

void ocfs2_schedule_truncate_log_flush ( struct ocfs2_super osb,
int  cancel 
)

Definition at line 6029 of file alloc.c.

int ocfs2_search_extent_list ( struct ocfs2_extent_list el,
u32  v_cluster 
)

Definition at line 773 of file alloc.c.

void ocfs2_set_inode_data_inline ( struct inode inode,
struct ocfs2_dinode di 
)

Definition at line 6785 of file alloc.c.

int ocfs2_split_extent ( handle_t *  handle,
struct ocfs2_extent_tree et,
struct ocfs2_path path,
int  split_index,
struct ocfs2_extent_rec split_rec,
struct ocfs2_alloc_context meta_ac,
struct ocfs2_cached_dealloc_ctxt dealloc 
)

Definition at line 4997 of file alloc.c.

int ocfs2_trim_fs ( struct super_block sb,
struct fstrim_range range 
)

Definition at line 7249 of file alloc.c.

int ocfs2_truncate_inline ( struct inode inode,
struct buffer_head *  di_bh,
unsigned int  start,
unsigned int  end,
int  trunc 
)

Definition at line 7117 of file alloc.c.

int ocfs2_truncate_log_append ( struct ocfs2_super osb,
handle_t *  handle,
u64  start_blk,
unsigned int  num_clusters 
)

Definition at line 5780 of file alloc.c.

int ocfs2_truncate_log_init ( struct ocfs2_super osb)

Definition at line 6222 of file alloc.c.

int ocfs2_truncate_log_needs_flush ( struct ocfs2_super osb)

Definition at line 5747 of file alloc.c.

void ocfs2_truncate_log_shutdown ( struct ocfs2_super osb)

Definition at line 6204 of file alloc.c.

int ocfs2_zero_range_for_truncate ( struct inode inode,
handle_t *  handle,
u64  range_start,
u64  range_end 
)

Definition at line 6691 of file alloc.c.