Linux Kernel
3.7.1
|
#include <linux/sched.h>
#include <linux/pagemap.h>
#include <linux/writeback.h>
#include <linux/blkdev.h>
#include <linux/sort.h>
#include <linux/rcupdate.h>
#include <linux/kthread.h>
#include <linux/slab.h>
#include <linux/ratelimit.h>
#include "compat.h"
#include "hash.h"
#include "ctree.h"
#include "disk-io.h"
#include "print-tree.h"
#include "transaction.h"
#include "volumes.h"
#include "locking.h"
#include "free-space-cache.h"
Go to the source code of this file.
Data Structures | |
struct | walk_control |
Macros | |
#define | DROP_REFERENCE 1 |
#define | UPDATE_BACKREF 2 |
Enumerations | |
enum | { CHUNK_ALLOC_NO_FORCE = 0, CHUNK_ALLOC_LIMITED = 1, CHUNK_ALLOC_FORCE = 2 } |
enum | { RESERVE_FREE = 0, RESERVE_ALLOC = 1, RESERVE_ALLOC_NO_ACCOUNT = 2 } |
enum | flush_state { FLUSH_DELAYED_ITEMS_NR = 1, FLUSH_DELAYED_ITEMS = 2, FLUSH_DELALLOC = 3, FLUSH_DELALLOC_WAIT = 4, ALLOC_CHUNK = 5, COMMIT_TRANS = 6 } |
enum | btrfs_loop_type { LOOP_CACHING_NOWAIT = 0, LOOP_CACHING_WAIT = 1, LOOP_ALLOC_CHUNK = 2, LOOP_NO_EMPTY_SIZE = 3 } |
Variables | |
enum { ... } | __attribute__ |
#define DROP_REFERENCE 1 |
Definition at line 6398 of file extent-tree.c.
#define UPDATE_BACKREF 2 |
Definition at line 6399 of file extent-tree.c.
anonymous enum |
Definition at line 53 of file extent-tree.c.
anonymous enum |
Definition at line 68 of file extent-tree.c.
enum btrfs_loop_type |
Definition at line 5492 of file extent-tree.c.
enum flush_state |
FLUSH_DELAYED_ITEMS_NR | |
FLUSH_DELAYED_ITEMS | |
FLUSH_DELALLOC | |
FLUSH_DELALLOC_WAIT | |
ALLOC_CHUNK | |
COMMIT_TRANS |
Definition at line 3820 of file extent-tree.c.
u64 btrfs_account_ro_block_groups_free_space | ( | struct btrfs_space_info * | sinfo | ) |
Definition at line 7323 of file extent-tree.c.
|
read |
Definition at line 4126 of file extent-tree.c.
|
read |
Definition at line 6326 of file extent-tree.c.
int btrfs_alloc_logged_file_extent | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | root_objectid, | ||
u64 | owner, | ||
u64 | offset, | ||
struct btrfs_key * | ins | ||
) |
Definition at line 6167 of file extent-tree.c.
int btrfs_alloc_reserved_file_extent | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | root_objectid, | ||
u64 | owner, | ||
u64 | offset, | ||
struct btrfs_key * | ins | ||
) |
Definition at line 6146 of file extent-tree.c.
int btrfs_block_rsv_add | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
u64 | num_bytes | ||
) |
Definition at line 4169 of file extent-tree.c.
int btrfs_block_rsv_add_noflush | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
u64 | num_bytes | ||
) |
Definition at line 4176 of file extent-tree.c.
int btrfs_block_rsv_check | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
int | min_factor | ||
) |
Definition at line 4183 of file extent-tree.c.
int btrfs_block_rsv_migrate | ( | struct btrfs_block_rsv * | src_rsv, |
struct btrfs_block_rsv * | dst_rsv, | ||
u64 | num_bytes | ||
) |
Definition at line 4245 of file extent-tree.c.
int btrfs_block_rsv_refill | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
u64 | min_reserved | ||
) |
Definition at line 4231 of file extent-tree.c.
int btrfs_block_rsv_refill_noflush | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
u64 | min_reserved | ||
) |
Definition at line 4238 of file extent-tree.c.
void btrfs_block_rsv_release | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
u64 | num_bytes | ||
) |
Definition at line 4252 of file extent-tree.c.
int btrfs_can_relocate | ( | struct btrfs_root * | root, |
u64 | bytenr | ||
) |
Definition at line 7364 of file extent-tree.c.
Definition at line 3361 of file extent-tree.c.
void btrfs_clear_space_info_full | ( | struct btrfs_fs_info * | info | ) |
Definition at line 641 of file extent-tree.c.
void btrfs_create_pending_block_groups | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root | ||
) |
Definition at line 7787 of file extent-tree.c.
int btrfs_cross_ref_exist | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | objectid, | ||
u64 | offset, | ||
u64 | bytenr | ||
) |
Definition at line 2757 of file extent-tree.c.
int btrfs_dec_ref | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
struct extent_buffer * | buf, | ||
int | full_backref, | ||
int | for_cow | ||
) |
Definition at line 2870 of file extent-tree.c.
btrfs_delalloc_release_metadata - release a metadata reservation for an inode : the inode to release the reservation for : the number of bytes we're releasing
This will release the metadata reservation for an inode. This can be called once we complete IO for a given set of bytes to release their metadata reservations.
Definition at line 4641 of file extent-tree.c.
btrfs_delalloc_release_space - release data and metadata space for delalloc : inode we're releasing space for : the number of bytes we want to free up
This must be matched with a call to btrfs_delalloc_reserve_space. This is called in the case that we don't need the metadata AND data reservations anymore. So if there is an error or we insert an inline extent.
This function will release the metadata space that was not used and will decrement ->delalloc_bytes and remove it from the fs_info delalloc_inodes list if there are no delalloc bytes left.
Definition at line 4712 of file extent-tree.c.
Definition at line 4527 of file extent-tree.c.
btrfs_delalloc_reserve_space - reserve data and metadata space for delalloc : inode we're writing to : the number of bytes we want to allocate
This will do the following things
o reserve space in the data space info for num_bytes o reserve space in the metadata space info based on number of outstanding extents and how much csums will be needed o add to the inodes ->delalloc_bytes o add it to the fs_info's delalloc inodes list.
This will return 0 for success and -ENOSPC if there is no space left.
Definition at line 4682 of file extent-tree.c.
int btrfs_delayed_refs_qgroup_accounting | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_fs_info * | fs_info | ||
) |
Definition at line 2414 of file extent-tree.c.
int btrfs_drop_snapshot | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | block_rsv, | ||
int | update_ref, | ||
int | for_reloc | ||
) |
Definition at line 6879 of file extent-tree.c.
int btrfs_drop_subtree | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
struct extent_buffer * | node, | ||
struct extent_buffer * | parent | ||
) |
Definition at line 7077 of file extent-tree.c.
int btrfs_error_discard_extent | ( | struct btrfs_root * | root, |
u64 | bytenr, | ||
u64 | num_bytes, | ||
u64 * | actual_bytes | ||
) |
Definition at line 8081 of file extent-tree.c.
int btrfs_error_unpin_extent_range | ( | struct btrfs_root * | root, |
u64 | start, | ||
u64 | end | ||
) |
Definition at line 8076 of file extent-tree.c.
int btrfs_extent_readonly | ( | struct btrfs_root * | root, |
u64 | bytenr | ||
) |
Definition at line 3163 of file extent-tree.c.
u64 btrfs_find_block_group | ( | struct btrfs_root * | root, |
u64 | search_start, | ||
u64 | search_hint, | ||
int | owner | ||
) |
Definition at line 670 of file extent-tree.c.
int btrfs_finish_extent_commit | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root | ||
) |
Definition at line 5008 of file extent-tree.c.
int btrfs_force_chunk_alloc | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | type | ||
) |
Definition at line 7276 of file extent-tree.c.
int btrfs_free_and_pin_reserved_extent | ( | struct btrfs_root * | root, |
u64 | start, | ||
u64 | len | ||
) |
Definition at line 6005 of file extent-tree.c.
int btrfs_free_block_groups | ( | struct btrfs_fs_info * | info | ) |
Definition at line 7552 of file extent-tree.c.
void btrfs_free_block_rsv | ( | struct btrfs_root * | root, |
struct btrfs_block_rsv * | rsv | ||
) |
Definition at line 4142 of file extent-tree.c.
int btrfs_free_extent | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytenr, | ||
u64 | num_bytes, | ||
u64 | parent, | ||
u64 | root_objectid, | ||
u64 | owner, | ||
u64 | offset, | ||
int | for_cow | ||
) |
Definition at line 5386 of file extent-tree.c.
Definition at line 3459 of file extent-tree.c.
int btrfs_free_reserved_extent | ( | struct btrfs_root * | root, |
u64 | start, | ||
u64 | len | ||
) |
Definition at line 5999 of file extent-tree.c.
void btrfs_free_tree_block | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
struct extent_buffer * | buf, | ||
u64 | parent, | ||
int | last_ref | ||
) |
Definition at line 5337 of file extent-tree.c.
u64 btrfs_get_alloc_profile | ( | struct btrfs_root * | root, |
int | data | ||
) |
Definition at line 3343 of file extent-tree.c.
int btrfs_inc_extent_ref | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytenr, | ||
u64 | num_bytes, | ||
u64 | parent, | ||
u64 | root_objectid, | ||
u64 | owner, | ||
u64 | offset, | ||
int | for_cow | ||
) |
Definition at line 1876 of file extent-tree.c.
int btrfs_inc_ref | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
struct extent_buffer * | buf, | ||
int | full_backref, | ||
int | for_cow | ||
) |
Definition at line 2864 of file extent-tree.c.
void btrfs_init_block_rsv | ( | struct btrfs_block_rsv * | rsv, |
unsigned short | type | ||
) |
Definition at line 4119 of file extent-tree.c.
|
read |
Definition at line 6222 of file extent-tree.c.
int btrfs_init_space_info | ( | struct btrfs_fs_info * | fs_info | ) |
Definition at line 8038 of file extent-tree.c.
|
read |
Definition at line 607 of file extent-tree.c.
int btrfs_lookup_extent | ( | struct btrfs_root * | root, |
u64 | start, | ||
u64 | len | ||
) |
Definition at line 720 of file extent-tree.c.
int btrfs_lookup_extent_info | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytenr, | ||
u64 | num_bytes, | ||
u64 * | refs, | ||
u64 * | flags | ||
) |
Definition at line 748 of file extent-tree.c.
int btrfs_make_block_group | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytes_used, | ||
u64 | type, | ||
u64 | chunk_objectid, | ||
u64 | chunk_offset, | ||
u64 | size | ||
) |
Definition at line 7815 of file extent-tree.c.
Definition at line 4409 of file extent-tree.c.
int btrfs_orphan_reserve_metadata | ( | struct btrfs_trans_handle * | trans, |
struct inode * | inode | ||
) |
Definition at line 4391 of file extent-tree.c.
Definition at line 4839 of file extent-tree.c.
int btrfs_pin_extent_for_log_replay | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytenr, | ||
u64 | num_bytes | ||
) |
Definition at line 4856 of file extent-tree.c.
void btrfs_prepare_extent_commit | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root | ||
) |
Definition at line 4936 of file extent-tree.c.
void btrfs_put_block_group | ( | struct btrfs_block_group_cache * | cache | ) |
Definition at line 123 of file extent-tree.c.
void btrfs_put_block_group_cache | ( | struct btrfs_fs_info * | info | ) |
Definition at line 7518 of file extent-tree.c.
int btrfs_read_block_groups | ( | struct btrfs_root * | root | ) |
Definition at line 7633 of file extent-tree.c.
u64 btrfs_reduce_alloc_profile | ( | struct btrfs_root * | root, |
u64 | flags | ||
) |
Definition at line 3279 of file extent-tree.c.
int btrfs_remove_block_group | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | group_start | ||
) |
Definition at line 7900 of file extent-tree.c.
int btrfs_reserve_extent | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | num_bytes, | ||
u64 | min_alloc_size, | ||
u64 | empty_size, | ||
u64 | hint_byte, | ||
struct btrfs_key * | ins, | ||
u64 | data | ||
) |
Definition at line 5930 of file extent-tree.c.
int btrfs_run_delayed_refs | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
unsigned long | count | ||
) |
Definition at line 2458 of file extent-tree.c.
int btrfs_set_block_group_ro | ( | struct btrfs_root * | root, |
struct btrfs_block_group_cache * | cache | ||
) |
Definition at line 7240 of file extent-tree.c.
void btrfs_set_block_group_rw | ( | struct btrfs_root * | root, |
struct btrfs_block_group_cache * | cache | ||
) |
Definition at line 7340 of file extent-tree.c.
int btrfs_set_disk_extent_flags | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root, | ||
u64 | bytenr, | ||
u64 | num_bytes, | ||
u64 | flags, | ||
int | is_data | ||
) |
Definition at line 2591 of file extent-tree.c.
int btrfs_snap_reserve_metadata | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_pending_snapshot * | pending | ||
) |
Definition at line 4418 of file extent-tree.c.
void btrfs_trans_release_metadata | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root | ||
) |
Definition at line 4375 of file extent-tree.c.
int btrfs_trim_fs | ( | struct btrfs_root * | root, |
struct fstrim_range * | range | ||
) |
Definition at line 8087 of file extent-tree.c.
int btrfs_write_dirty_block_groups | ( | struct btrfs_trans_handle * | trans, |
struct btrfs_root * | root | ||
) |
Definition at line 3042 of file extent-tree.c.
enum { ... } __attribute__ |