Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
alloc.c File Reference
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/swap.h>
#include <linux/quotaops.h>
#include <linux/blkdev.h>
#include <cluster/masklog.h>
#include "ocfs2.h"
#include "alloc.h"
#include "aops.h"
#include "blockcheck.h"
#include "dlmglue.h"
#include "extent_map.h"
#include "inode.h"
#include "journal.h"
#include "localalloc.h"
#include "suballoc.h"
#include "sysfile.h"
#include "file.h"
#include "super.h"
#include "uptodate.h"
#include "xattr.h"
#include "refcounttree.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h"

Go to the source code of this file.

Data Structures

struct  ocfs2_extent_tree_operations
 
struct  ocfs2_insert_type
 
struct  ocfs2_merge_ctxt
 
struct  find_path_data
 
struct  ocfs2_cached_block_free
 
struct  ocfs2_per_slot_free_list
 

Macros

#define OCFS2_TRUNCATE_LOG_FLUSH_INTERVAL   (2 * HZ)
 

Typedefs

typedef voidpath_insert_t )(void *, struct buffer_head *)
 

Enumerations

enum  ocfs2_contig_type { CONTIG_NONE = 0, CONTIG_LEFT, CONTIG_RIGHT, CONTIG_LEFTRIGHT }
 
enum  ocfs2_append_type { APPEND_NONE = 0, APPEND_TAIL }
 
enum  ocfs2_split_type { SPLIT_NONE = 0, SPLIT_LEFT, SPLIT_RIGHT }
 

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)
 
void ocfs2_reinit_path (struct ocfs2_path *path, int keep_root)
 
void ocfs2_free_path (struct ocfs2_path *path)
 
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_search_extent_list (struct ocfs2_extent_list *el, u32 v_cluster)
 
int ocfs2_read_extent_block (struct ocfs2_caching_info *ci, u64 eb_blkno, struct buffer_head **bh)
 
int ocfs2_num_free_extents (struct ocfs2_super *osb, struct ocfs2_extent_tree *et)
 
int ocfs2_find_subtree_root (struct ocfs2_extent_tree *et, struct ocfs2_path *left, struct ocfs2_path *right)
 
int ocfs2_find_path (struct ocfs2_caching_info *ci, struct ocfs2_path *path, u32 cpos)
 
int ocfs2_find_leaf (struct ocfs2_caching_info *ci, struct ocfs2_extent_list *root_el, u32 cpos, struct buffer_head **leaf_bh)
 
int ocfs2_find_cpos_for_left_leaf (struct super_block *sb, struct ocfs2_path *path, u32 *cpos)
 
int ocfs2_find_cpos_for_right_leaf (struct super_block *sb, struct ocfs2_path *path, u32 *cpos)
 
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_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_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_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_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_flush_truncate_log (struct ocfs2_super *osb)
 
void ocfs2_schedule_truncate_log_flush (struct ocfs2_super *osb, int cancel)
 
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)
 
void ocfs2_truncate_log_shutdown (struct ocfs2_super *osb)
 
int ocfs2_truncate_log_init (struct ocfs2_super *osb)
 
int ocfs2_cache_cluster_dealloc (struct ocfs2_cached_dealloc_ctxt *ctxt, u64 blkno, unsigned int bit)
 
int ocfs2_run_deallocs (struct ocfs2_super *osb, struct ocfs2_cached_dealloc_ctxt *ctxt)
 
int ocfs2_cache_block_dealloc (struct ocfs2_cached_dealloc_ctxt *ctxt, int type, int slot, u64 suballoc, u64 blkno, unsigned int bit)
 
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)
 
int ocfs2_grab_pages (struct inode *inode, loff_t start, loff_t end, struct page **pages, int *num)
 
int ocfs2_zero_range_for_truncate (struct inode *inode, handle_t *handle, u64 range_start, u64 range_end)
 
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_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_trim_fs (struct super_block *sb, struct fstrim_range *range)
 

Macro Definition Documentation

#define OCFS2_TRUNCATE_LOG_FLUSH_INTERVAL   (2 * HZ)

Definition at line 6028 of file alloc.c.

Typedef Documentation

typedef void( path_insert_t)(void *, struct buffer_head *)

Definition at line 1767 of file alloc.c.

Enumeration Type Documentation

Enumerator:
APPEND_NONE 
APPEND_TAIL 

Definition at line 858 of file alloc.c.

Enumerator:
CONTIG_NONE 
CONTIG_LEFT 
CONTIG_RIGHT 
CONTIG_LEFTRIGHT 

Definition at line 57 of file alloc.c.

Enumerator:
SPLIT_NONE 
SPLIT_LEFT 
SPLIT_RIGHT 

Definition at line 863 of file alloc.c.

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.