Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155918
b: refs/heads/master
c: 817d52f
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jul 24, 2009
1 parent bf57f8f commit 967015f
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 125 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 963030817060e4f109be1993b9ae8f81dbf5e11a
refs/heads/master: 817d52f8dba26d0295c26035531c30ce5f1e3c3e
22 changes: 19 additions & 3 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ struct btrfs_space_info {
struct list_head block_groups;
spinlock_t lock;
struct rw_semaphore groups_sem;
atomic_t caching_threads;
};

/*
Expand Down Expand Up @@ -721,27 +722,37 @@ struct btrfs_free_cluster {
struct list_head block_group_list;
};

enum btrfs_caching_type {
BTRFS_CACHE_NO = 0,
BTRFS_CACHE_STARTED = 1,
BTRFS_CACHE_FINISHED = 2,
};

struct btrfs_block_group_cache {
struct btrfs_key key;
struct btrfs_block_group_item item;
struct btrfs_fs_info *fs_info;
spinlock_t lock;
struct mutex cache_mutex;
u64 pinned;
u64 reserved;
u64 flags;
u64 sectorsize;
int extents_thresh;
int free_extents;
int total_bitmaps;
int cached;
int ro;
int dirty;

/* cache tracking stuff */
wait_queue_head_t caching_q;
int cached;

struct btrfs_space_info *space_info;

/* free space cache stuff */
spinlock_t tree_lock;
struct rb_root free_space_offset;
u64 free_space;

/* block group cache stuff */
struct rb_node cache_node;
Expand Down Expand Up @@ -834,6 +845,7 @@ struct btrfs_fs_info {
atomic_t async_submit_draining;
atomic_t nr_async_bios;
atomic_t async_delalloc_pages;
atomic_t async_caching_threads;

/*
* this is used by the balancing code to wait for all the pending
Expand Down Expand Up @@ -950,6 +962,9 @@ struct btrfs_root {
/* the node lock is held while changing the node pointer */
spinlock_t node_lock;

/* taken when updating the commit root */
struct rw_semaphore commit_root_sem;

struct extent_buffer *commit_root;
struct btrfs_root *log_root;
struct btrfs_root *reloc_root;
Expand Down Expand Up @@ -1911,7 +1926,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
struct btrfs_root *root, unsigned long count);
int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len);
int btrfs_update_pinned_extents(struct btrfs_root *root,
u64 bytenr, u64 num, int pin);
u64 bytenr, u64 num, int pin, int mark_free);
int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct extent_buffer *leaf);
int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans,
Expand Down Expand Up @@ -1996,6 +2011,7 @@ void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode,
u64 bytes);
void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode,
u64 bytes);
void btrfs_free_super_mirror_extents(struct btrfs_fs_info *info);
/* ctree.c */
int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
int level, int *slot);
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
spin_lock_init(&root->inode_lock);
mutex_init(&root->objectid_mutex);
mutex_init(&root->log_mutex);
init_rwsem(&root->commit_root_sem);
init_waitqueue_head(&root->log_writer_wait);
init_waitqueue_head(&root->log_commit_wait[0]);
init_waitqueue_head(&root->log_commit_wait[1]);
Expand Down Expand Up @@ -1566,6 +1567,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
atomic_set(&fs_info->async_delalloc_pages, 0);
atomic_set(&fs_info->async_submit_draining, 0);
atomic_set(&fs_info->nr_async_bios, 0);
atomic_set(&fs_info->async_caching_threads, 0);
fs_info->sb = sb;
fs_info->max_extent = (u64)-1;
fs_info->max_inline = 8192 * 1024;
Expand Down Expand Up @@ -2337,6 +2339,7 @@ int close_ctree(struct btrfs_root *root)
free_extent_buffer(root->fs_info->csum_root->commit_root);

btrfs_free_block_groups(root->fs_info);
btrfs_free_super_mirror_extents(root->fs_info);

del_fs_roots(fs_info);

Expand Down
Loading

0 comments on commit 967015f

Please sign in to comment.