search for: nritems

Displaying 20 results from an estimated 28 matches for "nritems".

Did you mean: nitems
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...trans, struct btrfs_root *root, struct extent_buffer *buf, @@ -135,26 +208,25 @@ int __btrfs_cow_block(struct btrfs_trans struct extent_buffer **cow_ret, u64 search_start, u64 empty_size) { - u64 parent_start; + u64 generation; struct extent_buffer *cow; - u32 nritems; - int ret = 0; - int different_trans = 0; + struct btrfs_disk_key disk_key; int level; WARN_ON(root->ref_cows && trans->transid != root->fs_info->running_transaction->transid); WARN_ON(root->ref_cows && trans->transid != root->last_trans); - if...
2008 Jul 20
26
[PATCH] NFS support for btrfs - v2
...; +} + +static struct dentry *btrfs_get_parent(struct dentry *child) +{ + struct inode *dir = child->d_inode; + struct inode *inode; + struct dentry *parent; + struct btrfs_root *root = BTRFS_I(dir)->root; + struct btrfs_key key; + struct btrfs_path *path; + struct extent_buffer *leaf; + u32 nritems; + int slot; + u64 objectid; + int ret; + + 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]; +...
2011 Jan 28
0
[PATCH] ctree code cleanups
..., 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 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...the compressed size of an inode on disk + * by counting the on-disk space used by all of its extents. + */ + struct inode *inode = fdentry(file)->d_inode; + struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_path *path; + struct extent_buffer *leaf; + struct btrfs_key key; + u32 nritems; + int slot; + u64 olen = inode->i_size; + u64 len = olen; + long ret; + u64 compressed_size = 0; + + if (S_ISDIR(inode->i_mode)) + return -EISDIR; + + path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; + + path->reada = 2; + mutex_lock(&inode->i_mutex); + + /* do any pendi...
2009 Jan 21
0
[PATCH] Progs: update convert for uninitialized block groups
...41,7 @@ static 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, +...
2008 Sep 25
0
[PATCH 2/4] Add shared reference cache
...diff -r 47aa0c51998a extent-tree.c --- a/extent-tree.c Thu Sep 25 16:00:36 2008 +0800 +++ b/extent-tree.c Thu Sep 25 16:02:11 2008 +0800 @@ -1091,15 +1091,25 @@ int btrfs_cache_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct extent_buffer *buf, u32 nr_extents) { - u32 nritems; struct btrfs_key key; struct btrfs_file_extent_item *fi; - int i; - int level; - int ret = 0; + u64 root_gen; + u32 nritems; + int i; + int level; + int ret = 0; + int shared = 0; if (!root->ref_cows) return 0; + + if (root->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID) { + sha...
2012 Apr 09
0
[PATCH] Btrfs-progs: make btrfsck aware of free space inodes
...ze = 1; 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-&...
2013 Jun 17
0
[PATCH] Btrfs: optimize reada_for_balance
...the path, or zero if everything was in - * cache - */ -static noinline int reada_for_balance(struct btrfs_root *root, - struct btrfs_path *path, int level) +static noinline void reada_for_balance(struct btrfs_root *root, + struct btrfs_path *path, 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 =...
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 Jun 29
14
[PATCH v4 0/6] btrfs: generic readeahead interface
This series introduces a generic readahead interface for btrfs trees. The intention is to use it to speed up scrub in a first run, but balance is another hot candidate. In general, every tree walk could be accompanied by a readahead. Deletion of large files comes to mind, where the fetching of the csums takes most of the time. Also the initial build-ups of free-space-caches and
2011 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
...fs/btrfs/ctree.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, +...
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
2011 Apr 27
2
btrfs-convert crashes
...nfo available. #2 0x000000000040502c in btrfs_extend_item (trans=<value optimized out>, root=0x633920, path=<value optimized out>, data_size=27) at ctree.c:2525 slot =<value optimized out> slot_orig =<value optimized out> leaf = 0x1955250 nritems = 1 data_end =<value optimized out> old_data =<value optimized out> i =<value optimized out> __PRETTY_FUNCTION__ = "btrfs_extend_item" #3 0x000000000040e32d in btrfs_insert_inode_ref (trans=0xc9ef10, root=0x633920, name=0xcfa314 &quot...
2011 Jun 10
6
[PATCH v2 0/6] btrfs: generic readeahead interface
This series introduces a generic readahead interface for btrfs trees. The intention is to use it to speed up scrub in a first run, but balance is another hot candidate. In general, every tree walk could be accompanied by a readahead. Deletion of large files comes to mind, where the fetching of the csums takes most of the time. Also the initial build-ups of free-space-caches and
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...root; struct btrfs_path *path; @@ -858,8 +857,8 @@ static int get_reference_status(struct b struct btrfs_extent_ref *ref_item; struct btrfs_key key; struct btrfs_key found_key; - u64 root_objectid = root->root_key.objectid; - u64 ref_generation; + u64 ref_root; + u64 last_snapshot; u32 nritems; int ret; @@ -872,7 +871,9 @@ static int get_reference_status(struct b if (ret < 0) goto out; BUG_ON(ret == 0); - if (ret < 0 || path->slots[0] == 0) + + ret = -ENOENT; + if (path->slots[0] == 0) goto out; path->slots[0]--; @@ -880,14 +881,10 @@ static int get_refer...
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...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 >...
2012 Jun 20
8
[PATCH] Allow cross subvolume reflinks (2nd attempt)
Hello, This is the second attempt to bring in cross subvolume reflinks into btrfs. The first attempt was NAKed due to missing vfs mount checks and a clear description of what btrfs subvolumes are and probably also why cross subvolume reflinks are ok in the case of btrfs. This version of the patch comes from David and is in SUSE kernels since a long time, so it is tested and working. The patch
2013 Aug 14
23
[RFC] btrfs-progs: fix sparse checking and warnings
Hi gang, I was a little surprised to see that patch go by recently which fixed an endian bug. I went to see how sparse checking looked and it was.. broken. I got it going again in my Fedora environment. Most of the patches are just cleanups, but there *were* three real bugs lurking in all that sparse warning spam. So I maintain that it''s worth our time to keep it going and fix
2012 May 27
0
[RFC PATCH] Decrease Metadata Fragment Using A Caterpillar Band Method
...pty_size, 1); + } + if (IS_ERR(cow)) return PTR_ERR(cow); diff -urpN a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h --- a/fs/btrfs/ctree.h 2012-05-21 18:42:51.000000000 +0000 +++ b/fs/btrfs/ctree.h 2012-05-27 19:12:16.839574840 +0000 @@ -341,6 +341,7 @@ struct btrfs_header { __le64 owner; __le32 nritems; u8 level; + u8 cater_index_factor; } __attribute__ ((__packed__)); #define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \ @@ -544,6 +545,7 @@ struct btrfs_extent_item { __le64 refs; __le64 generation; __le64 flags; + u8 cater_index_factor; } __attribute__ ((__packed__)); struct...
2011 Jul 21
10
[PATCH v5 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup
While testing raid-auto-repair patches I''m going to send out later, I just found the very last bug in my current scrub patch series: Changelog v4->v5: - fixed a deadlock when fixup is taking longer while scrub is about to end Original message follows: ------------------------ This patch set introduces two new features for scrub. They share the backref iteration code which is the