Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ctree.c File Reference
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/rbtree.h>
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "print-tree.h"
#include "locking.h"

Go to the source code of this file.

Data Structures

struct  tree_mod_move
 
struct  tree_mod_root
 
struct  tree_mod_elem
 

Macros

#define ADVANCE   1
 
#define ADVANCE_ONLY_NEXT   -1
 

Enumerations

enum  mod_log_op {
  MOD_LOG_KEY_REPLACE, MOD_LOG_KEY_ADD, MOD_LOG_KEY_REMOVE, MOD_LOG_KEY_REMOVE_WHILE_FREEING,
  MOD_LOG_KEY_REMOVE_WHILE_MOVING, MOD_LOG_MOVE_KEYS, MOD_LOG_ROOT_REPLACE
}
 

Functions

struct extent_bufferread_old_tree_block (struct btrfs_root *root, u64 bytenr, u32 blocksize, u64 parent_transid, u64 time_seq)
 
struct extent_bufferbtrfs_find_old_tree_block (struct btrfs_root *root, u64 bytenr, u32 blocksize, u64 time_seq)
 
struct btrfs_pathbtrfs_alloc_path (void)
 
noinline void btrfs_set_path_blocking (struct btrfs_path *p)
 
noinline void btrfs_clear_path_blocking (struct btrfs_path *p, struct extent_buffer *held, int held_rw)
 
void btrfs_free_path (struct btrfs_path *p)
 
noinline void btrfs_release_path (struct btrfs_path *p)
 
struct extent_bufferbtrfs_root_node (struct btrfs_root *root)
 
struct extent_bufferbtrfs_lock_root_node (struct btrfs_root *root)
 
struct extent_bufferbtrfs_read_lock_root_node (struct btrfs_root *root)
 
int btrfs_copy_root (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *buf, struct extent_buffer **cow_ret, u64 new_root_objectid)
 
u64 btrfs_get_tree_mod_seq (struct btrfs_fs_info *fs_info, struct seq_list *elem)
 
void btrfs_put_tree_mod_seq (struct btrfs_fs_info *fs_info, struct seq_list *elem)
 
int btrfs_block_can_be_shared (struct btrfs_root *root, struct extent_buffer *buf)
 
int btrfs_old_root_level (struct btrfs_root *root, u64 time_seq)
 
noinline int btrfs_cow_block (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *buf, struct extent_buffer *parent, int parent_slot, struct extent_buffer **cow_ret)
 
int btrfs_comp_cpu_keys (struct btrfs_key *k1, struct btrfs_key *k2)
 
int btrfs_realloc_node (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *parent, int start_slot, int cache_only, u64 *last_ret, struct btrfs_key *progress)
 
int btrfs_bin_search (struct extent_buffer *eb, struct btrfs_key *key, int level, int *slot)
 
noinline void btrfs_unlock_up_safe (struct btrfs_path *path, int level)
 
int btrfs_search_slot (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, int ins_len, int cow)
 
int btrfs_search_old_slot (struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, u64 time_seq)
 
int btrfs_search_slot_for_read (struct btrfs_root *root, struct btrfs_key *key, struct btrfs_path *p, int find_higher, int return_any)
 
void btrfs_set_item_key_safe (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *new_key)
 
noinline int btrfs_leaf_free_space (struct btrfs_root *root, struct extent_buffer *leaf)
 
int btrfs_split_item (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *new_key, unsigned long split_offset)
 
int btrfs_duplicate_item (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *new_key)
 
void btrfs_truncate_item (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u32 new_size, int from_end)
 
void btrfs_extend_item (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, u32 data_size)
 
void setup_items_for_insert (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *cpu_key, u32 *data_size, u32 total_data, u32 total_size, int nr)
 
int btrfs_insert_empty_items (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *cpu_key, u32 *data_size, int nr)
 
int btrfs_insert_item (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_key *cpu_key, void *data, u32 data_size)
 
int btrfs_del_items (struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int slot, int nr)
 
int btrfs_prev_leaf (struct btrfs_root *root, struct btrfs_path *path)
 
int btrfs_search_forward (struct btrfs_root *root, struct btrfs_key *min_key, struct btrfs_key *max_key, struct btrfs_path *path, int cache_only, u64 min_trans)
 
int btrfs_compare_trees (struct btrfs_root *left_root, struct btrfs_root *right_root, btrfs_changed_cb_t changed_cb, void *ctx)
 
int btrfs_find_next_key (struct btrfs_root *root, struct btrfs_path *path, struct btrfs_key *key, int level, int cache_only, u64 min_trans)
 
int btrfs_next_leaf (struct btrfs_root *root, struct btrfs_path *path)
 
int btrfs_next_old_leaf (struct btrfs_root *root, struct btrfs_path *path, u64 time_seq)
 
int btrfs_previous_item (struct btrfs_root *root, struct btrfs_path *path, u64 min_objectid, int type)
 

Macro Definition Documentation

#define ADVANCE   1

Definition at line 5062 of file ctree.c.

#define ADVANCE_ONLY_NEXT   -1

Definition at line 5063 of file ctree.c.

Enumeration Type Documentation

enum mod_log_op
Enumerator:
MOD_LOG_KEY_REPLACE 
MOD_LOG_KEY_ADD 
MOD_LOG_KEY_REMOVE 
MOD_LOG_KEY_REMOVE_WHILE_FREEING 
MOD_LOG_KEY_REMOVE_WHILE_MOVING 
MOD_LOG_MOVE_KEYS 
MOD_LOG_ROOT_REPLACE 

Definition at line 301 of file ctree.c.

Function Documentation

struct btrfs_path* btrfs_alloc_path ( void  )
read

Definition at line 52 of file ctree.c.

int btrfs_bin_search ( struct extent_buffer eb,
struct btrfs_key key,
int  level,
int slot 
)

Definition at line 1661 of file ctree.c.

int btrfs_block_can_be_shared ( struct btrfs_root root,
struct extent_buffer buf 
)

Definition at line 814 of file ctree.c.

noinline void btrfs_clear_path_blocking ( struct btrfs_path p,
struct extent_buffer held,
int  held_rw 
)

Definition at line 85 of file ctree.c.

int btrfs_comp_cpu_keys ( struct btrfs_key k1,
struct btrfs_key k2 
)

Definition at line 1425 of file ctree.c.

int btrfs_compare_trees ( struct btrfs_root left_root,
struct btrfs_root right_root,
btrfs_changed_cb_t  changed_cb,
void ctx 
)

Definition at line 5078 of file ctree.c.

int btrfs_copy_root ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct extent_buffer buf,
struct extent_buffer **  cow_ret,
u64  new_root_objectid 
)

Definition at line 246 of file ctree.c.

noinline int btrfs_cow_block ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct extent_buffer buf,
struct extent_buffer parent,
int  parent_slot,
struct extent_buffer **  cow_ret 
)

Definition at line 1356 of file ctree.c.

int btrfs_del_items ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
int  slot,
int  nr 
)

Definition at line 4677 of file ctree.c.

int btrfs_duplicate_item ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key new_key 
)

Definition at line 4242 of file ctree.c.

void btrfs_extend_item ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
u32  data_size 
)

Definition at line 4378 of file ctree.c.

int btrfs_find_next_key ( struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key key,
int  level,
int  cache_only,
u64  min_trans 
)

Definition at line 5409 of file ctree.c.

struct extent_buffer* btrfs_find_old_tree_block ( struct btrfs_root root,
u64  bytenr,
u32  blocksize,
u64  time_seq 
)
read
void btrfs_free_path ( struct btrfs_path p)

Definition at line 124 of file ctree.c.

u64 btrfs_get_tree_mod_seq ( struct btrfs_fs_info fs_info,
struct seq_list elem 
)

Definition at line 372 of file ctree.c.

int btrfs_insert_empty_items ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key cpu_key,
u32 data_size,
int  nr 
)

Definition at line 4541 of file ctree.c.

int btrfs_insert_item ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_key cpu_key,
void data,
u32  data_size 
)

Definition at line 4575 of file ctree.c.

noinline int btrfs_leaf_free_space ( struct btrfs_root root,
struct extent_buffer leaf 
)

Definition at line 3323 of file ctree.c.

struct extent_buffer* btrfs_lock_root_node ( struct btrfs_root root)
read

Definition at line 193 of file ctree.c.

int btrfs_next_leaf ( struct btrfs_root root,
struct btrfs_path path 
)

Definition at line 5494 of file ctree.c.

int btrfs_next_old_leaf ( struct btrfs_root root,
struct btrfs_path path,
u64  time_seq 
)

Definition at line 5499 of file ctree.c.

int btrfs_old_root_level ( struct btrfs_root root,
u64  time_seq 
)

Definition at line 1307 of file ctree.c.

int btrfs_prev_leaf ( struct btrfs_root root,
struct btrfs_path path 
)

Definition at line 4796 of file ctree.c.

int btrfs_previous_item ( struct btrfs_root root,
struct btrfs_path path,
u64  min_objectid,
int  type 
)

Definition at line 5660 of file ctree.c.

void btrfs_put_tree_mod_seq ( struct btrfs_fs_info fs_info,
struct seq_list elem 
)

Definition at line 390 of file ctree.c.

struct extent_buffer* btrfs_read_lock_root_node ( struct btrfs_root root)
read

Definition at line 212 of file ctree.c.

int btrfs_realloc_node ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct extent_buffer parent,
int  start_slot,
int  cache_only,
u64 last_ret,
struct btrfs_key progress 
)

Definition at line 1447 of file ctree.c.

noinline void btrfs_release_path ( struct btrfs_path p)

Definition at line 138 of file ctree.c.

struct extent_buffer* btrfs_root_node ( struct btrfs_root root)
read

Definition at line 165 of file ctree.c.

int btrfs_search_forward ( struct btrfs_root root,
struct btrfs_key min_key,
struct btrfs_key max_key,
struct btrfs_path path,
int  cache_only,
u64  min_trans 
)

Definition at line 4846 of file ctree.c.

int btrfs_search_old_slot ( struct btrfs_root root,
struct btrfs_key key,
struct btrfs_path p,
u64  time_seq 
)

Definition at line 2730 of file ctree.c.

int btrfs_search_slot ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_key key,
struct btrfs_path p,
int  ins_len,
int  cow 
)

Definition at line 2463 of file ctree.c.

int btrfs_search_slot_for_read ( struct btrfs_root root,
struct btrfs_key key,
struct btrfs_path p,
int  find_higher,
int  return_any 
)

Definition at line 2838 of file ctree.c.

void btrfs_set_item_key_safe ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key new_key 
)

Definition at line 2934 of file ctree.c.

noinline void btrfs_set_path_blocking ( struct btrfs_path p)

Definition at line 63 of file ctree.c.

int btrfs_split_item ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key new_key,
unsigned long  split_offset 
)

Definition at line 4218 of file ctree.c.

void btrfs_truncate_item ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
u32  new_size,
int  from_end 
)

Definition at line 4276 of file ctree.c.

noinline void btrfs_unlock_up_safe ( struct btrfs_path path,
int  level 
)

Definition at line 2265 of file ctree.c.

struct extent_buffer* read_old_tree_block ( struct btrfs_root root,
u64  bytenr,
u32  blocksize,
u64  parent_transid,
u64  time_seq 
)
read
void setup_items_for_insert ( struct btrfs_trans_handle trans,
struct btrfs_root root,
struct btrfs_path path,
struct btrfs_key cpu_key,
u32 data_size,
u32  total_data,
u32  total_size,
int  nr 
)

Definition at line 4449 of file ctree.c.