search for: btrfs_header_nritems

Displaying 20 results from an estimated 43 matches for "btrfs_header_nritems".

2011 Jan 28
0
[PATCH] ctree code cleanups
...bin_search(eb, key, level, slot); -} - static void root_add_used(struct btrfs_root *root, u32 size) { spin_lock(&root->accounting_lock); @@ -1648,38 +1642,29 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans, int ret; if ((p->search_for_split || ins_len > 0) && btrfs_header_nritems(b) >= BTRFS_NODEPTRS_PER_BLOCK(root) - 3) { - int sret; - - sret = reada_for_balance(root, p, level); - if (sret) + ret = reada_for_balance(root, p, level); + if (ret) goto again; btrfs_set_path_blocking(p); - sret = split_node(trans, root, p, level); + ret = split_node(tran...
2010 Feb 01
0
[PATCH] btrfs: Fix oopsen when dropping empty tree.
...2/fs/btrfs/extent-tree.c --- 1/fs/btrfs/extent-tree.c 2010-01-22 12:16:34.203525744 +0800 +++ 2/fs/btrfs/extent-tree.c 2010-02-01 10:26:19.865562007 +0800 @@ -5402,10 +5402,6 @@ static noinline int walk_down_tree(struc int ret; while (level >= 0) { - if (path->slots[level] >= - btrfs_header_nritems(path->nodes[level])) - break; - ret = walk_down_proc(trans, root, path, wc, lookup_info); if (ret > 0) break; @@ -5413,6 +5409,10 @@ static noinline int walk_down_tree(struc if (level == 0) break; + if (path->slots[level] >= + btrfs_header_nritems(path->nod...
2013 Feb 13
1
[PATCH] Btrfs: fix crash in log replay with qgroups enabled
...deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index eea5da7..6eff0fa 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1222,7 +1222,7 @@ tree_mod_log_rewind(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, __tree_mod_log_rewind(eb_rewin, time_seq, tm); WARN_ON(btrfs_header_nritems(eb_rewin) > - BTRFS_NODEPTRS_PER_BLOCK(fs_info->fs_root)); + BTRFS_NODEPTRS_PER_BLOCK(fs_info->tree_root)); return eb_rewin; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More ma...
2009 Jun 03
0
[PATCH] Make sure all dirty blocks are written at commit time
...t; --- diff -urp 1/fs/btrfs/ctree.c 2/fs/btrfs/ctree.c --- 1/fs/btrfs/ctree.c 2009-06-02 10:53:14.614551240 +0800 +++ 2/fs/btrfs/ctree.c 2009-06-03 13:45:59.000000000 +0800 @@ -1043,9 +1043,6 @@ static noinline int balance_level(struct BTRFS_NODEPTRS_PER_BLOCK(root) / 4) return 0; - if (btrfs_header_nritems(mid) > 2) - return 0; - if (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...
2010 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...h for the inode */ + key.objectid = inode->i_ino; + key.type = BTRFS_EXTENT_DATA_KEY; + key.offset = 0; + + while (1) { + /* note the key will change type as we walk through the tree */ + ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + if (ret < 0) + goto out; + + nritems = btrfs_header_nritems(path->nodes[0]); + if (path->slots[0] >= nritems) { + ret = btrfs_next_leaf(root, path); + if (ret < 0) + goto out; + if (ret > 0) + break; + nritems = btrfs_header_nritems(path->nodes[0]); + } + leaf = path->nodes[0]; + slot = path->slots[0]; + + btrfs_it...
2009 Jul 07
0
[PATCH] speed up snapshot dropping
...uct btrfs_path *path, struct walk_control *wc) { - struct extent_buffer *next; - struct extent_buffer *cur; - u64 bytenr; - u64 ptr_gen; - u32 blocksize; int level = wc->level; int ret; while (level >= 0) { - cur = path->nodes[level]; - BUG_ON(path->slots[level] >= btrfs_header_nritems(cur)); + if (path->slots[level] >= + btrfs_header_nritems(path->nodes[level])) + break; ret = walk_down_proc(trans, root, path, wc); if (ret > 0) @@ -4789,20 +4869,12 @@ static noinline int walk_down_tree(struc if (level == 0) break; - bytenr = btrfs_node_block...
2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
...; + + path = btrfs_alloc_path(); + + key.objectid = dir->i_ino; + btrfs_set_key_type(&key, BTRFS_INODE_REF_KEY); + key.offset = 0; + ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + BUG_ON(ret == 0); + ret = 0; + + leaf = path->nodes[0]; + slot = path->slots[0]; + nritems = btrfs_header_nritems(leaf); + if (slot >= nritems) { + goto out; + } + + btrfs_item_key_to_cpu(leaf, &key, slot); + if (key.objectid != dir->i_ino || + key.type != BTRFS_INODE_REF_KEY) { + goto out; + } + + btrfs_free_path(path); + objectid = key.offset; + + /* Build a new key for the inode item */ + ke...
2011 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
...tree.c @@ -1229,6 +1229,7 @@ static void reada_for_search(struct btrfs_root *root, u64 search; u64 target; u64 nread = 0; + u64 gen; int direction = path->reada; struct extent_buffer *eb; u32 nr; @@ -1256,6 +1257,15 @@ static void reada_for_search(struct btrfs_root *root, nritems = btrfs_header_nritems(node); nr = slot; while (1) { + if (!node->map_token) { + unsigned long offset = btrfs_node_key_ptr_offset(nr); + map_private_extent_buffer(node, offset, + sizeof(struct btrfs_key_ptr), + &node->map_token, + &node->kaddr, + &node->map_sta...
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...t) - parent_start = parent->start; + level = btrfs_header_level(buf); + generation = btrfs_header_generation(buf); + + if (level == 0) + btrfs_item_key(buf, &disk_key, 0); else - parent_start = 0; + btrfs_node_key(buf, &disk_key, 0); - level = btrfs_header_level(buf); - nritems = btrfs_header_nritems(buf); - cow = btrfs_alloc_free_block(trans, root, buf->len, parent_start, - root->root_key.objectid, trans->transid, + cow = btrfs_alloc_free_block(trans, root, buf->len, + root->root_key.objectid, &disk_key, level, search_start, empty_size); if (IS_ER...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...path->nodes[level] = NULL; clean_tree_block(trans, root, mid); + + mid->root_objectid = 0; + btrfs_tree_unlock(mid); /* once for the path */ free_extent_buffer(mid); @@ -1726,6 +1732,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ret = wret; if (btrfs_header_nritems(right) == 0) { clean_tree_block(trans, root, right); + right->root_objectid = 0; btrfs_tree_unlock(right); del_ptr(trans, root, path, level + 1, pslot + 1, 1); root_sub_used(root, right->len); @@ -1770,6 +1777,7 @@ static noinline int balance_level(struct btrfs_trans_handle...
2013 May 07
2
[PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode
...sert(struct btrfs_trans_handle *trans, orig_slot += left_nr; btrfs_node_key(mid, &disk_key, 0); tree_mod_log_set_node_key(root->fs_info, parent, - pslot, 0); + pslot); btrfs_set_node_key(parent, &disk_key, pslot); btrfs_mark_buffer_dirty(parent); if (btrfs_header_nritems(left) > orig_slot) { @@ -2083,7 +2082,7 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans, btrfs_node_key(right, &disk_key, 0); tree_mod_log_set_node_key(root->fs_info, parent, - pslot + 1, 0); + pslot + 1); btrfs_set_node_key(parent...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...found_key.type != BTRFS_EXTENT_ITEM_KEY) { - ret = 1; + found_key.type != BTRFS_EXTENT_ITEM_KEY) goto out; - } - - *ref_count = 0; - *min_generation = (u64)-1; + last_snapshot = btrfs_root_last_snapshot(&root->root_item); while (1) { leaf = path->nodes[0]; nritems = btrfs_header_nritems(leaf); @@ -910,114 +907,22 @@ static int get_reference_status(struct b ref_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_ref); - ref_generation = btrfs_ref_generation(leaf, ref_item); - /* - * For (parent_gen > 0 && parent_gen > ref_generation): -...
2012 Apr 09
0
[PATCH] Btrfs-progs: make btrfsck aware of free space inodes
...node->data = rec; + if (ino == BTRFS_FREE_INO_OBJECTID) + rec->found_link = 1; + ret = insert_existing_cache_extent(inode_cache, &node->cache); BUG_ON(ret); } @@ -1015,6 +1018,10 @@ static int process_one_leaf(struct btrfs_root *root, struct extent_buffer *eb, nritems = btrfs_header_nritems(eb); for (i = 0; i < nritems; i++) { btrfs_item_key_to_cpu(eb, &key, i); + + if (key.objectid == BTRFS_FREE_SPACE_OBJECTID) + continue; + if (active_node->current == NULL || active_node->current->ino < key.objectid) { if (active_node->current) { -- 1.7.5...
2013 Jun 17
0
[PATCH] Btrfs: optimize reada_for_balance
...int level) { int slot; int nritems; @@ -2192,12 +2188,11 @@ static noinline int reada_for_balance(struct btrfs_root *root, u64 gen; u64 block1 = 0; u64 block2 = 0; - int ret = 0; int blocksize; parent = path->nodes[level + 1]; if (!parent) - return 0; + return; nritems = btrfs_header_nritems(parent); slot = path->slots[level + 1]; @@ -2224,28 +2219,11 @@ static noinline int reada_for_balance(struct btrfs_root *root, block2 = 0; free_extent_buffer(eb); } - if (block1 || block2) { - ret = -EAGAIN; - - /* release the whole path */ - btrfs_release_path(path); - /* read...
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...f, extent); - ram_bytes = btrfs_file_extent_ram_bytes(leaf, - extent); - found_extent = 1; - } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { - found_inline = 1; - extent_end = key.offset + - btrfs_file_extent_inline_len(leaf, extent); + if (path->slots[0] >= btrfs_header_nritems(leaf)) { + BUG_ON(del_nr > 0); + ret = btrfs_next_leaf(root, path); + if (ret < 0) + break; + if (ret > 0) { + ret = 0; + break; } + leaf = path->nodes[0]; + recow = 1; + } + + btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); + if (key.objectid >...
2009 Jan 21
0
[PATCH] Progs: update convert for uninitialized block groups
...atic int relocate_one_reference(struct key.offset = 0; } btrfs_init_path(&path); +recow: ret = btrfs_search_slot(trans, root, &key, &path, -1, 1); if (ret < 0) goto fail; @@ -1936,8 +1949,17 @@ static int relocate_one_reference(struct leaf = path.nodes[0]; nritems = btrfs_header_nritems(leaf); while (1) { - if (path.slots[0] >= nritems) - break; + if (path.slots[0] >= nritems) { + ret = btrfs_next_leaf(root, &path); + if (ret < 0) + goto fail; + if (ret > 0) + break; + btrfs_item_key_to_cpu(path.nodes[0], &key, + path.slots[0]); +...
2014 Sep 16
0
3.14.18 btrfs_set_item_key_safe BUG
...struct extent_buffer *eb; int slot; eb = path->nodes[0]; slot = path->slots[0]; if (slot > 0) { btrfs_item_key(eb, &disk_key, slot - 1); BUG_ON(comp_keys(&disk_key, new_key) >= 0); } if (slot < btrfs_header_nritems(eb) - 1) { btrfs_item_key(eb, &disk_key, slot + 1); BUG_ON(comp_keys(&disk_key, new_key) <= 0); <--- } Full backtrace: kernel BUG at /home/apw/COD/linux/fs/btrfs/ctree.c:3215! invalid opcode: 0000 [#1] SMP Modules linked in: nfsd nfs_acl auth_...
2012 Feb 13
1
Cross-subvolume reflink copy (BTRFS_IOC_CLONE over subvolume boundaries)
It''s been nearly a year since the patches needed to implement a reflinked copy between subvolumes have been posted (http://permalink.gmane.org/gmane.comp.file-systems.btrfs/9865 ) and I still get "Invalid cross-device link" error with Linux 3.2.4 while I try to do a cp --reflink between subvolumes. This is a *very* useful feature to have (think offline file-level
2011 May 20
1
btrfsck: couldn't open because of unsupported option features (8)
After upgrading from 2.6.39-rc7 to 2.6.39 this morning, I tried to mount my 3 disk btrfs volume (no subvolumes, space caching enabled, lzo compression) and received some parent transid errors (going back to rc7 didn''t help, though): btrfs: disk space caching is enabled parent transid verify failed on 6038227976192 wanted 337418 found 337853 parent transid verify failed on 6038227976192
2011 Jun 21
19
[GIT PULL v3] Btrfs: improve write ahead log with sub transaction
I''ve been working to try to improve the write-ahead log''s performance, and I found that the bottleneck addresses in the checksum items, especially when we want to make a random write on a large file, e.g a 4G file. Then a idea for this suggested by Chris is to use sub transaction ids and just to log the part of inode that had changed since either the last log commit or the last