Displaying 18 results from an estimated 18 matches for "btrfs_drop_extents".
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
Rewrite btrfs_drop_extents by using btrfs_duplicate_item, so we can
avoid calling lock_extent within transaction.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
---
fs/btrfs/ctree.h | 7 +-
fs/btrfs/file.c | 659 ++++++++++++++++++++-------------------------------
fs/btrfs/inode.c | 27 +--
fs/btrfs/...
2007 Sep 19
0
i_blocks and delay allocation
Hello
I found that after defrag a file, the corresponding inode's i_blocks
become incorrect. I hope
following description address the real reason.
i_blocks is decreased in 'btrfs_drop_extents' when something are
drop/truncated and 'run_delalloc_range' calls 'btrfs_drop_extents' at
first place, so 'run_delalloc_range' may decrease the i_blocks.
('btrfs_drop_extents' doesn't increase i_blocks). In normal write
operation, i_blocks is increased in a...
2011 Jun 21
19
[GIT PULL v3] Btrfs: improve write ahead log with sub transaction
..., I rebase the patchset to the latest for-linus
branch.
More tests are welcome!
You can also get this patchset from:
git://repo.or.cz/linux-btrfs-devel.git sub-trans
Liu Bo (12):
Btrfs: introduce sub transaction stuff
Btrfs: update block generation if should_cow_block fails
Btrfs: modify btrfs_drop_extents API
Btrfs: introduce first sub trans
Btrfs: still update inode trans stuff when size remains unchanged
Btrfs: improve log with sub transaction
Btrfs: add checksum check for log
Btrfs: fix a bug of log check
Btrfs: kick off useless code
Btrfs: deal with EEXIST after iput
Btrfs: use t...
2011 Jan 18
6
BUG while writing to USB btrfs filesystem
While untar''ing an image to an sd card via a reader, I got the
following bug. The system also has a btrfs root, and a whole swath of
processes went into uninterruptable sleep. I was able to poke around
via ssh and sysrq, and already had netconsole set up to capture the
bug.
Root fs is on /dev/sdi1, and /dev/sdj2 is the card reader which was
the target of the untar.
[29571.448889] sd
2012 May 22
1
warnings met in introduce extent buffer cache for each i-node patch
...2c31c1>] btrfs_search_slot+0x241/0x720
May 22 09:23:57 bigbox kernel: [56455.5326fff812c3adc>] btrfs_search_slot_for_inode+0x43c/0x910
May 22 09:23:57 bigbox kernel: [56455.532fffffff812d5f04>] btrfs_lookup_file_extent+0x54/0x70
May 22 09:23:57 bigbox kernel: [56455.532646ffff812f097c>] btrfs_drop_extents+0xec/0x940
May 22 09:23:57 bigbox kernel: [56455.532662] fff81084eec>] ? try_to_wake_up+0x1bc/0x2b0
May 22 09:23:57 bigbox kernel: [56455.53268 [<ffffffff812facef>] ? set_state_bits+0x3f/0x80
May 22 09:23:57 bigbox kernel: [56455fff8116228c>] ? kmem_cache_alloc+0x10c/0x140
May 22 09:23:...
2011 Aug 18
0
[PATCH 3/3] Btrfs: fix unclosed transaction handle in btrfs_cont_expand()
...| 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 634dd797..ee57b40 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3510,15 +3510,19 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
err = btrfs_drop_extents(trans, inode, cur_offset,
cur_offset + hole_size,
&hint_byte, 1);
- if (err)
+ if (err) {
+ btrfs_end_transaction(trans, root);
break;
+ }
err = btrfs_insert_file_extent(trans, root,
btrfs_ino(inode), cur_offset, 0,
0, hole_size, 0, hole_size,...
2009 Feb 16
0
warn_slowpath in clean_tree_block
...t;ffffffffa03f0de5>] btrfs_item_offset+0xb3/0xbe [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03c96bc>] leaf_space_used+0xb5/0xe8 [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03d0ebd>] btrfs_search_slot+0x917/0x99b [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03ef06a>] btrfs_drop_extents+0xa75/0xab3 [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03d14ee>] btrfs_insert_empty_items+0x7f/0x49d [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03e6f0f>] insert_reserved_file_extent+0xd9/0x230 [btrfs]
Feb 16 09:02:17 vlad kernel: [<ffffffffa03fa44f>] set_extent_bit+0x220...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...>last_log_commit = root->last_log_commit;
+ return 0;
+ }
+
+ /*
+ * 1 - for the one we''re dropping
+ * 1 - for the one we''re adding
+ * 1 - for updating the inode.
+ */
+ trans = btrfs_start_transaction(root, 3);
+ if (IS_ERR(trans))
+ return PTR_ERR(trans);
+
+ ret = btrfs_drop_extents(trans, root, inode, offset, offset + len, 1);
+ if (ret) {
+ btrfs_abort_transaction(trans, root, ret);
+ btrfs_end_transaction(trans, root);
+ return ret;
+ }
+
+ ret = btrfs_insert_file_extent(trans, root, btrfs_ino(inode), offset,
+ 0, 0, len, 0, len, 0, 0, 0);
+ if (ret)
+ btrfs_a...
2011 May 31
2
WARNING: at fs/btrfs/extent-tree.c:5695 btrfs_alloc_free_block+0x22c/0x370 [btrfs]()
...ost kernel: [17117.213778] [<ffffffffa01a8b5c>] ?
btrfs_search_slot+0x1dc/0x9b0 [btrfs]
May 30 23:25:17 localhost kernel: [17117.213807] [<ffffffffa01bb493>] ?
btrfs_lookup_file_extent+0x33/0x40 [btrfs]
May 30 23:25:17 localhost kernel: [17117.213837] [<ffffffffa01d32b0>] ?
btrfs_drop_extents+0xc0/0x960 [btrfs]
May 30 23:25:17 localhost kernel: [17117.213847] [<ffffffff810096a5>] ?
__switch_to+0xc5/0x300
May 30 23:25:17 localhost kernel: [17117.213854] [<ffffffff811f2861>] ?
rb_insert_color+0x101/0x140
May 30 23:25:17 localhost kernel: [17117.213863] [<ffffffff81...
2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...ns(+), 53 deletions(-)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index aebfb2d..705aee6 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -589,7 +589,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
/* drop any overlapping extents */
ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 1);
- BUG_ON(ret);
+ if (ret)
+ goto out;
if (found_type == BTRFS_FILE_EXTENT_REG ||
found_type == BTRFS_FILE_EXTENT_PREALLOC) {
@@ -599,7 +600,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
ret = btrfs_insert_empt...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...tent_key->objectid,
@@ -6807,7 +6807,7 @@ next:
btrfs_header_owner(leaf),
btrfs_header_generation(leaf),
key.objectid, 0);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
btrfs_release_path(root, path);
key.offset += num_bytes;
@@ -6825,7 +6825,7 @@ next:
ret = btrfs_drop_extents(trans, root, inode, key.offset,
key.offset + num_bytes,
key.offset, &alloc_hint);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
for (i = 0; i < nr_extents; i++) {
if (ext_offset >= new_extents[i].num_bytes) {
@@ -6838,7 +6838,7 @@ next:
ret = btrfs_insert...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...&file_key, path, ins_len, cow);
+ ret = btrfs_search_slot_for_inode(trans, root, inode, &file_key, path,
+ ins_len, cow);
return ret;
}
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index fc0f485..c98a3cb 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -611,7 +611,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode,
while (1) {
recow = 0;
- ret = btrfs_lookup_file_extent(trans, root, path, ino,
+ ret = btrfs_lookup_file_extent(trans, root, path, inode,
search_start, modify_tree);
if (ret < 0)
break;
@@ -905,7 +905,8 @@ again...
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp
in the kernel to make sure the data is still the same. The thing that takes a
while is reading the data up from disk, so doing a memcmp of the entire buffer
isn''t that big of a deal, not to mention there''s a possiblity for malicious
users if there is a problem with the hashing algorithms we
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 May 11
8
[PATCH 1/4] Btrfs: map the node block when looking for readahead targets
If we have particularly full nodes, we could call btrfs_node_blockptr up to 32
times, which is 32 pairs of kmap/kunmap, which _sucks_. So go ahead and map the
extent buffer while we look for readahead targets. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
---
fs/btrfs/ctree.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...rans,
lock_extent(io_tree, start_pos, end_of_last_block, GFP_NOFS);
trans = btrfs_join_transaction(root, 1);
- if (!trans) {
- err = -ENOMEM;
+ if (IS_ERR(trans)) {
+ err = PTR_ERR(trans);
goto out_unlock;
}
btrfs_set_trans_block_group(trans, inode);
@@ -323,6 +323,10 @@ noinline int btrfs_drop_extents(struct btrfs_trans_handle *trans,
while (1) {
recow = 0;
btrfs_release_path(root, path);
+ ret = btrfs_extend_transaction(trans, root, 1);
+ if (ret)
+ goto out;
+
ret = btrfs_lookup_file_extent(trans, root, path, inode->i_ino,
search_start, -1);
if (ret < 0)
@@...
2012 Apr 20
44
Ceph on btrfs 3.4rc
After running ceph on XFS for some time, I decided to try btrfs again.
Performance with the current "for-linux-min" branch and big metadata
is much better. The only problem (?) I''m still seeing is a warning
that seems to occur from time to time:
[87703.784552] ------------[ cut here ]------------
[87703.789759] WARNING: at fs/btrfs/inode.c:2103
2011 Jan 05
52
Offline Deduplication for Btrfs
Here are patches to do offline deduplication for Btrfs. It works well for the
cases it''s expected to, I''m looking for feedback on the ioctl interface and
such, I''m well aware there are missing features for the userspace app (like
being able to set a different blocksize). If this interface is acceptable I
will flesh out the userspace app a little more, but I believe the