search for: btrfs_path

Displaying 20 results from an estimated 59 matches for "btrfs_path".

2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...id = 0; btrfs_tree_unlock(mid); del_ptr(trans, root, path, level + 1, pslot, 1); root_sub_used(root, mid->len); @@ -2270,6 +2278,22 @@ read_block_for_search(struct btrfs_trans_handle *trans, return ret; } +static int check_nodes_need_balance(struct btrfs_root *root, + struct btrfs_path *p, + struct extent_buffer *b, + int level, int ins_len) +{ + if ((p->search_for_split || ins_len > 0) && btrfs_header_nritems(b) >= + BTRFS_NODEPTRS_PER_BLOCK(root) - 3) + return 1; + + if (ins_len < 0 && + btrfs_header_nritems(b) < BTRFS_NODEP...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...+++++++++++++++++++++++++++++++++++++++++++++++--- 6 files changed, 377 insertions(+), 56 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 33e9dbd..cb20e4d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -41,7 +41,6 @@ static void del_ptr(struct btrfs_root *root, struct btrfs_path *path, int level, int slot); static void tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb); -static int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); struct btrfs_path *btrfs_alloc_path(void) { @@ -4819,7 +4818,7 @@ int btrfs_del_it...
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
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...ath->slots[0] += old_left_nritems; @@ -1931,34 +1962,96 @@ static int push_leaf_left(struct btrfs_t * * returns 0 if all went well and < 0 on failure. */ -static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root - *root, struct btrfs_key *ins_key, - struct btrfs_path *path, int data_size, int extend) +static noinline int copy_for_split(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_path *path, + struct extent_buffer *l, + struct extent_buffer *right, + int slot, int mid, int nritems) { +...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...aned inodes */ + struct list_head i_orphan; + u64 ordered_trans; /* * transid of the trans_handle that last modified this inode diff -r 99b12e2db0f8 ctree.h --- a/ctree.h Wed Jun 18 20:50:41 2008 -0400 +++ b/ctree.h Tue Jun 24 21:04:39 2008 -0400 @@ -103,7 +103,8 @@ extern struct kmem_cache *btrfs_path_cac #define BTRFS_FT_SOCK 6 #define BTRFS_FT_SYMLINK 7 #define BTRFS_FT_XATTR 8 -#define BTRFS_FT_MAX 9 +#define BTRFS_FT_ORPHAN_DIR 9 +#define BTRFS_FT_MAX 10 /* * the key defines the order in the tree, and so it also defines (optimal) @@ -613,6 +614,10 @@ struct btrfs_root { /* th...
2013 Aug 02
2
[PATCH] Btrfs: allow compressed extents to be merged during defragment
...le.com> --- fs/btrfs/inode.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 55dda87..a7aeecc 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2229,7 +2229,7 @@ static noinline bool record_extent_backrefs(struct btrfs_path *path, static int relink_is_mergable(struct extent_buffer *leaf, struct btrfs_file_extent_item *fi, - u64 disk_bytenr) + u64 disk_bytenr, u8 compress) { if (btrfs_file_extent_disk_bytenr(leaf, fi) != disk_bytenr) return 0; @@ -2237,8 +2237,10 @@ static int relink_...
2013 May 22
0
[PATCH 1/2] Btrfs: dont do log_removal in insert_new_root
...s/btrfs/ctree.c index 02fae7f..c07b6ea 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -3143,7 +3143,7 @@ static int balance_node_right(struct btrfs_trans_handle *trans, */ static noinline int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, - struct btrfs_path *path, int level, int log_removal) + struct btrfs_path *path, int level) { u64 lower_gen; struct extent_buffer *lower; @@ -3194,7 +3194,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, btrfs_mark_buffer_dirty(c); old = root->node; - tree_mod_log_set_root...
2013 Jun 17
0
[PATCH] Btrfs: optimize reada_for_balance
...trfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -2178,12 +2178,8 @@ static void reada_for_search(struct btrfs_root *root, } } -/* - * returns -EAGAIN if it had to drop 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; - in...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2012 Sep 17
13
[PATCH 1/2 v3] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag
We''re going to use this flag EXTENT_DEFRAG to indicate which range belongs to defragment so that we can implement snapshow-aware defrag: We set the EXTENT_DEFRAG flag when dirtying the extents that need defragmented, so later on writeback thread can differentiate between normal writeback and writeback started by defragmentation. This patch is used for the latter one. Originally patch
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
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...fs_root *root, u64 bytenr, - u64 parent_gen, u64 ref_objectid, - u64 *min_generation, u32 *ref_count) +int btrfs_cross_ref_exist(struct btrfs_trans_handle *trans, + struct btrfs_root *root, u64 bytenr) { struct btrfs_root *extent_root = root->fs_info->extent_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; @@...
2013 Jan 07
3
[PATCH] btrfs: add "no file data" flag to btrfs send ioctl
...H(sctx, BTRFS_SEND_A_PATH, p); + TLV_PUT_U64(sctx, BTRFS_SEND_A_FILE_OFFSET, offset); + TLV_PUT_U64(sctx, BTRFS_SEND_A_SIZE, len); + + ret = send_cmd(sctx); + +tlv_put_failure: +out: + fs_path_free(sctx, p); + return ret; +} + static int send_write_or_clone(struct send_ctx *sctx, struct btrfs_path *path, struct btrfs_key *key, @@ -3742,7 +3776,11 @@ static int send_write_or_clone(struct send_ctx *sctx, goto out; } - if (!clone_root) { + if (clone_root) { + ret = send_clone(sctx, offset, len, clone_root); + } else if (sctx->flags & BTRFS_SEND_FLAG_NO_FILE_DATA) { +...
2010 Aug 13
1
[PATCH] btrfs: avoid duplications by moving the static int array from header to c file
...truct btrfs_super_block *s) +{ + static const int btrfs_csum_sizes[] = { 4, 0 }; + + int t = btrfs_super_csum_type(s); + BUG_ON(t >= ARRAY_SIZE(btrfs_csum_sizes)); + return btrfs_csum_sizes[t]; +} + static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int level); static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e9bf864..99220ee 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -132,8 +132,6 @@ struct btrfs_ordered_sum; /* csum types */ #define BTRFS_C...
2011 Oct 06
26
[PATCH v0 00/18] btfs: Subvolume Quota Groups
This is a first draft of a subvolume quota implementation. It is possible to limit subvolumes and any group of subvolumes and also to track the amount of space that will get freed when deleting snapshots. The current version is functionally incomplete, with the main missing feature being the initial scan and rescan of an existing filesystem. I put some effort into writing an introduction into
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...ata_bytes_referenced = 0; @@ -91,6 +92,7 @@ struct extent_record { unsigned int content_checked:1; unsigned int owner_ref_checked:1; unsigned int is_root:1; + unsigned int metadata:1; }; struct inode_backref { @@ -1208,7 +1210,7 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path, WARN_ON(*level >= BTRFS_MAX_LEVEL); ret = btrfs_lookup_extent_info(NULL, root, path->nodes[*level]->start, - path->nodes[*level]->len, &refs, NULL); + *level, 1, &refs, NULL); if (ret < 0) goto out; @@ -1236,8 +1238,8 @@ st...
2009 Jul 07
0
[PATCH] speed up snapshot dropping
...F. if the block is shared and there is no + * need to update back, this function drops the reference + * to the block. + * + * NOTE: return value 1 means we should stop walking down. + */ +static noinline int do_walk_down(struct btrfs_trans_handle *trans, + struct btrfs_root *root, + struct btrfs_path *path, + struct walk_control *wc) +{ + u64 bytenr; + u64 generation; + u64 parent; + u32 blocksize; + struct btrfs_key key; + struct extent_buffer *next = NULL; + int level = wc->level; + int ret = 0; + + generation = btrfs_node_ptr_generation(path->nodes[level], + path->slo...
2015 Dec 24
4
[PATCH] btrfs: Fix logical to physical block address mapping
...(fs, key, chunk); } } @@ -356,8 +367,8 @@ static void btrfs_read_chunk_tree(struct fs_info *fs) { struct btrfs_info * const bfs = fs->fs_info; struct btrfs_disk_key search_key; + struct btrfs_disk_key ignore_key; struct btrfs_chunk *chunk; - struct btrfs_chunk_map_item item; struct btrfs_path path; if (!(bfs->sb.flags & BTRFS_SUPER_FLAG_METADUMP)) { @@ -370,17 +381,24 @@ static void btrfs_read_chunk_tree(struct fs_info *fs) clear_path(&path); search_tree(fs, bfs->sb.chunk_root, &search_key, &path); do { + ignore_key.objectid = BTRFS_DEV_ITEMS_OBJECTI...
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
2013 May 07
2
[PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode
..., &disk_key, 0); tree_mod_log_set_node_key(root->fs_info, parent, - pslot + 1, 0); + pslot + 1); btrfs_set_node_key(parent, &disk_key, pslot + 1); btrfs_mark_buffer_dirty(parent); @@ -2963,7 +2962,7 @@ static void fixup_low_keys(struct btrfs_root *root, struct btrfs_path *path, if (!path->nodes[i]) break; t = path->nodes[i]; - tree_mod_log_set_node_key(root->fs_info, t, tslot, 1); + tree_mod_log_set_node_key(root->fs_info, t, tslot); btrfs_set_node_key(t, key, tslot); btrfs_mark_buffer_dirty(path->nodes[i]); if (tslot != 0) -- 1...