search for: btrfs_block_group_cache

Displaying 20 results from an estimated 32 matches for "btrfs_block_group_cache".

2011 May 25
0
[PATCH] Btrfs: cache bitmaps when searching for a cluster
...- 1 files changed, 49 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index d634a7e..0bfea7b 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -2062,6 +2062,7 @@ again: */ static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group, struct btrfs_free_cluster *cluster, + struct list_head *bitmaps, u64 offset, u64 bytes, u64 min_bytes) { struct btrfs_free_space *first = NULL; @@ -2083,6 +2084,8 @@ static int setup_cluster_no_bitmap(struct btrfs_block_group_cache *block_group, * extent en...
2009 Jun 03
0
[PATCH] Make sure all dirty blocks are written at commit time
...btrfs_header_nritems(mid) < 2) err_on_enospc = 1; diff -urp 1/fs/btrfs/extent-tree.c 2/fs/btrfs/extent-tree.c --- 1/fs/btrfs/extent-tree.c 2009-06-02 10:53:14.620550670 +0800 +++ 2/fs/btrfs/extent-tree.c 2009-06-03 10:52:58.000000000 +0800 @@ -2399,13 +2399,29 @@ fail: } +static struct btrfs_block_group_cache * +next_block_group(struct btrfs_root *root, + struct btrfs_block_group_cache *cache) +{ + struct rb_node *node; + spin_lock(&root->fs_info->block_group_cache_lock); + node = rb_next(&cache->cache_node); + btrfs_put_block_group(cache); + if (node) { + cache = rb_entry(node, stru...
2008 Oct 10
1
[PATCH] fix enospc when there is plenty of space
...*/ struct list_head block_groups; spinlock_t lock; + struct rw_semaphore groups_sem; }; struct btrfs_free_space { diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 280ac1a..ad648a3 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -317,59 +317,6 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group(struct return cache; } -static int noinline find_free_space(struct btrfs_root *root, - struct btrfs_block_group_cache **cache_ret, - u64 *start_ret, u64 num, int data) -{ - int ret; - struct btrfs_block_group_cache *cache = *cache_ret; - struct btrfs_fre...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...nclude "commands.h" +#include "free-space-cache.h" static u64 bytes_used = 0; static u64 total_csum_bytes = 0; @@ -2787,6 +2788,209 @@ static int check_csums(struct btrfs_root *root) return errors; } +static int check_cache_range(struct btrfs_root *root, + struct btrfs_block_group_cache *cache, + u64 offset, u64 bytes) +{ + struct btrfs_free_space *entry; + u64 *logical; + u64 bytenr; + int stripe_len; + int i, nr, ret; + + for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { + bytenr = btrfs_sb_offset(i); + ret = btrfs_rmap_block(&root->fs_info->mapping_tree, +...
2013 Mar 15
0
[PATCH] Btrfs: add some free space cache tests
....c b/fs/btrfs/free-space-cache.c index 1f84fc0..fcde73d 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -2967,3 +2967,522 @@ int btrfs_write_out_ino_cache(struct btrfs_root *root, iput(inode); return ret; } + +#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS +static struct btrfs_block_group_cache *init_test_block_group(void) +{ + struct btrfs_block_group_cache *cache; + + cache = kzalloc(sizeof(*cache), GFP_NOFS); + if (!cache) + return NULL; + cache->free_space_ctl = kzalloc(sizeof(*cache->free_space_ctl), + GFP_NOFS); + if (!cache->free_space_ctl) { + kfree(cache); + retur...
2011 Jul 26
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations
...644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2198,8 +2198,6 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, u64 root_objectid, u64 owner, u64 offset); int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); -int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, - u64 num_bytes, int reserve, int sinfo); int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans, struct btrfs_root *root); int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, @@ -2269,8 +2267,11 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info...
2011 Jul 27
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations V2
...644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2198,8 +2198,6 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, u64 root_objectid, u64 owner, u64 offset); int btrfs_free_reserved_extent(struct btrfs_root *root, u64 start, u64 len); -int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache, - u64 num_bytes, int reserve, int sinfo); int btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans, struct btrfs_root *root); int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, @@ -2269,8 +2267,11 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info...
2009 Jul 31
1
[PATCH] Btrfs: make sure we find a bitmap entry
...+--------- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index af99b78..691ea95 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -414,11 +414,20 @@ static noinline int remove_from_bitmap(struct btrfs_block_group_cache *block_gro u64 *offset, u64 *bytes) { u64 end; + u64 search_start, search_bytes; + int ret; again: end = bitmap_info->offset + (u64)(BITS_PER_BITMAP * block_group->sectorsize) - 1; + search_start = *offset; + search_bytes = *bytes; + + ret = search_bitmap(block_group, b...
2007 Nov 12
0
[PATCH]Minor fix for find_search_start
...volume, Oops occurs when space usage is about 76%. After apply the patch, Oops occurs when space usage is near 100%. Regards YZ ---- diff -r 433cf4043126 extent-tree.c --- a/extent-tree.c Sun Nov 11 08:22:00 2007 -0500 +++ b/extent-tree.c Mon Nov 12 18:44:36 2007 +0800 @@ -161,7 +161,8 @@ struct btrfs_block_group_cache *btrfs_lo static u64 find_search_start(struct btrfs_root *root, struct btrfs_block_group_cache **cache_ret, - u64 search_start, int num, int data) + u64 search_start, int num, + int data, int full_scan) { int ret; struct btrfs_block_group_cache *cache = *cache_r...
2012 Jan 11
12
[PATCH 00/11] Btrfs: some patches for 3.3
The biggest one is a fix for fstrim, and there''s a fix for on-disk free space cache. Others are small fixes and cleanups. The last three have been sent weeks ago. The patchset is also available in this repo: git://repo.or.cz/linux-btrfs-devel.git for-chris Note there''s a small confict with Al Viro''s vfs changes. Li Zefan (11): Btrfs: add pinned extents to
2009 Mar 20
1
[PATCH 2/4] Btrfs: clean up find_free_extent
.../btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2552,14 +2552,10 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root *root = orig_root->fs_info->extent_root; u64 total_needed = num_bytes; u64 *last_ptr = NULL; - u64 last_wanted = 0; struct btrfs_block_group_cache *block_group = NULL; - int chunk_alloc_done = 0; int empty_cluster = 2 * 1024 * 1024; int allowed_chunk_alloc = 0; - struct list_head *head = NULL, *cur = NULL; - int loop = 0; - int extra_loop = 0; + int using_hint = 0; struct btrfs_space_info *space_info; WARN_ON(num_bytes < root-&gt...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...ent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4799,7 +4799,7 @@ static u64 stripe_align(struct btrfs_root *root, u64 val) * and look in the rbtree for a free extent of a given size, but this * is a good start. */ -static noinline int +static noinline void wait_block_group_cache_progress(struct btrfs_block_group_cache *cache, u64 num_bytes) { @@ -4808,16 +4808,15 @@ wait_block_group_cache_progress(struct btrfs_block_group_cache *cache, caching_ctl = get_caching_control(cache); if (!caching_ctl) - return 0; + return; wait_event(caching_ctl->wait, block_group_cache_done(cache) || (cache-...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...c 2008-10-27 21:26:31.000000000 +0800 @@ -201,108 +201,144 @@ out: */ static int run_delalloc_nocow(struct inode *inode, u64 start, u64 end) { - u64 extent_start; - u64 extent_end; - u64 bytenr; - u64 loops = 0; - u64 total_fs_bytes; struct btrfs_root *root = BTRFS_I(inode)->root; - struct btrfs_block_group_cache *block_group; struct btrfs_trans_handle *trans; struct extent_buffer *leaf; - int found_type; struct btrfs_path *path; - struct btrfs_file_extent_item *item; - int ret; - int err = 0; + struct btrfs_file_extent_item *fi; + struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;...
2010 Apr 19
0
Memory barrier not required in cached_block_group
Hi all, It seems like memory barrier is not required in cached_block_group.I am looking at kernel 2.6.34-rc2. cache_block_group(struct btrfs_block_group_cache *cache) { smp_mb(); if (cache->cached != BTRFS_CACHE_NO) return 0; .... } This function is called from btrfs_alloc_logged_file_extent and find_free_extent. In btrfs_alloc_logged_file_extent the code snippet is as follows block_group = btrfs_lookup_block_group(root->fs_info, ins->obj...
2012 Jan 10
0
[PATCH V2] Btrfs: cleanup: move node-,leaf-,sectorsize to fs_info
moved the node-,leaf-,sectorsize from btrfs_root to btrfs_fs_info since we don''t intend to allow different sizes between trees also removed sectorsize from btrfs_block_group_cache because it now can use the one in fs_info updated all uses accordingly please note in disk-io.c: -static int __setup_root(nodesize, leafsize, sectorsize, stripesize, - *root, *fs_info, objectid) +static int __setup_root(stripesize, *root, *fs_info, objectid) Signe...
2012 Jan 23
0
[PATCH] Btrfs: use cluster->window_start when allocating from a cluster bitmap
...ace-cache.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 35bfe3c..43e75f2 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -2242,7 +2242,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group, if (entry->bitmap) { ret = btrfs_alloc_from_bitmap(block_group, cluster, entry, bytes, - min_start); + cluster->window_start); if (ret == 0) { node = rb_next(&entry->offset_index); if (!node) -- 1.7.5.2 -- To unsub...
2009 Aug 05
3
RAID[56] with arbitrary numbers of "parity" stripes.
...MASK; } + if (avail && extra_flags & BTRFS_BLOCK_GROUP_RAID56) { + u64 nr_spares = flags >> 56; + + if (nr_spares > *avail >> 56) + *avail = (*avail & BTRFS_BLOCK_GROUP_MASK) | + nr_spares << 56; + } } static void set_block_group_readonly(struct btrfs_block_group_cache *cache) @@ -2643,27 +2653,27 @@ static void set_block_group_readonly(struct btrfs_block_group_cache *cache) u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) { u64 num_devices = root->fs_info->fs_devices->rw_devices; + u64 num_spares = flags >> 56; u64 tmp;...
2011 Aug 15
9
[patch v2 0/9] btrfs: More error handling patches
Hi all - The following 9 patches add more error handling to the btrfs code: - Add btrfs_panic - Catch locking failures in {set,clear}_extent_bit - Push up set_extent_bit errors to callers - Push up lock_extent errors to callers - Push up clear_extent_bit errors to callers - Push up unlock_extent errors to callers - Make pin_down_extent return void - Push up btrfs_pin_extent errors to
2007 Aug 09
1
[RFC] All my fsync changes
...but I'm not entirely sure, so if I need to be doing this elsewhere please let me know. Thanks much, Josef diff -r f6da57af2473 btrfs_inode.h --- a/btrfs_inode.h Wed Aug 08 20:17:12 2007 -0400 +++ b/btrfs_inode.h Thu Aug 09 16:04:17 2007 -0400 @@ -25,6 +25,11 @@ struct btrfs_inode { struct btrfs_block_group_cache *block_group; struct btrfs_key location; struct inode vfs_inode; + + /* + * transid of the trans_handle that last modified this inode + */ + u64 last_trans; }; static inline struct btrfs_inode *BTRFS_I(struct inode *inode) { diff -r f6da57af2473 ctree.h --- a/ctree.h Wed Aug 08 20:17:12 20...
2011 Oct 04
68
[patch 00/65] Error handling patchset v3
Hi all - Here''s my current error handling patchset, against 3.1-rc8. Almost all of this patchset is preparing for actual error handling. Before we start in on that work, I''m trying to reduce the surface we need to worry about. It turns out that there is a ton of code that returns an error code but never actually reports an error. The patchset has grown to 65 patches. 46 of them