Displaying 20 results from an estimated 26 matches for "cur_offset".
Did you mean:
csum_offset
2010 Jan 22
2
[PATCH -v2] btrfs: Use correct values when updating inode i_size on fallocate
Even though we allocate more, we should be updating inode i_size
as per the arguments passed
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
Changes from V1:
We should update i_size only if actual_len and cur_offset are both
larger than i_size. Otherwise if actual_len is < i_size and cur_offset > i_size
we may end up setting wrong i_size value
fs/btrfs/inode.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5440bab..a...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...26 17:28:20.489839672 +0800
+++ 3/fs/btrfs/inode.c 2010-04-26 17:28:20.500829420 +0800
@@ -1174,6 +1174,13 @@ out_check:
num_bytes, num_bytes, type);
BUG_ON(ret);
+ if (root->root_key.objectid ==
+ BTRFS_DATA_RELOC_TREE_OBJECTID) {
+ ret = btrfs_reloc_clone_csums(inode, cur_offset,
+ num_bytes);
+ BUG_ON(ret);
+ }
+
extent_clear_unlock_delalloc(inode, &BTRFS_I(inode)->io_tree,
cur_offset, cur_offset + num_bytes - 1,
locked_page, EXTENT_CLEAR_UNLOCK_PAGE |
@@ -6079,16 +6086,15 @@ out_unlock:
return err;
}
-static int prealloc_file_range(...
2009 Nov 02
0
[PATCH 7/8] Make fallocate(2) more ENOSPC friendly
...ON(1);
- goto out;
+ break;
+ }
+
+ ret = btrfs_reserve_metadata_space(root, 3);
+ if (ret) {
+ btrfs_free_reserved_extent(root, ins.objectid,
+ ins.offset);
+ break;
}
+
+ trans = btrfs_start_transaction(root, 1);
+
ret = insert_reserved_file_extent(trans, inode,
cur_offset, ins.objectid,
ins.offset, ins.offset,
@@ -5611,22 +5672,25 @@ static int prealloc_file_range(struct bt
BUG_ON(ret);
btrfs_drop_extent_cache(inode, cur_offset,
cur_offset + ins.offset -1, 0);
+
num_bytes -= ins.offset;
cur_offset += ins.offset;
alloc_hint = ins.objecti...
2010 Nov 22
0
[PATCH] Btrfs: fix typo in fallocate to make it honor actual size
There is a typo in __btrfs_prealloc_file_range() where we set the i_size to
actual_len/cur_offset, and then just set it to cur_offset again, and do the same
with btrfs_ordered_update_i_size(). This fixes it back to keeping i_size in a
local variable and then updating i_size properly. Tested this with
xfs_io -F -f -c "falloc 0 1" -c "pwrite 0 1" foo
stat''ing foo...
2008 Oct 27
0
[PATCH 3/4] update nodatacow code
...;
- 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;
+ struct extent_map *em;
struct btrfs_key found_key;
+ u64 cow_start;
+ u64 cur_offset;
+ u64 extent_end;
+ u64 disk_bytenr;
+ int extent_type;
+ int ret;
+ int type;
+ int nocow;
+ int check_prev = 1;
- total_fs_bytes = btrfs_super_total_bytes(&root->fs_info->super_copy);
path = btrfs_alloc_path();
BUG_ON(!path);
trans = btrfs_join_transaction(root, 1);
BUG_ON(!t...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...btrfs_root *root = BTRFS_I(inode)->root;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
struct extent_map *em = NULL;
@@ -4267,31 +4309,10 @@ int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
struct extent_map *hole_em;
hole_size = last_byte - cur_offset;
- trans = btrfs_start_transaction(root, 3);
- if (IS_ERR(trans)) {
- err = PTR_ERR(trans);
- break;
- }
-
- err = btrfs_drop_extents(trans, root, inode,
- cur_offset,
- cur_offset + hole_size, 1);
- if (err) {
- btrfs_abort_transaction(trans, root, err);
- btrfs...
2011 Aug 18
0
[PATCH 3/3] Btrfs: fix unclosed transaction handle in btrfs_cont_expand()
..., 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,
0, 0, 0);
- if (err)...
2013 Jun 04
3
[PATCH] Btrfs: fix broken nocow after balance
...i + 1);
if (btrfs_extent_inline_ref_type(leaf, iref) !=
BTRFS_EXTENT_DATA_REF_KEY)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 23c596c..0dc5c7d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1253,7 +1253,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
cur_offset = start;
while (1) {
ret = btrfs_lookup_file_extent(trans, root, path, ino,
- cur_offset, 0);
+ cur_offset, 1);
if (ret < 0) {
btrfs_abort_transaction(trans, root, ret);
goto error;
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe...
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...compressed, 0, 0,
BTRFS_FILE_EXTENT_REG);
unpin_extent_cache(&BTRFS_I(inode)->extent_tree,
@@ -3209,11 +3204,9 @@ int btrfs_cont_expand(struct inode *inode, loff_t size)
if (test_bit(EXTENT_FLAG_VACANCY, &em->flags)) {
u64 hint_byte = 0;
hole_size = last_byte - cur_offset;
- err = btrfs_drop_extents(trans, root, inode,
- cur_offset,
+ err = btrfs_drop_extents(trans, inode, cur_offset,
cur_offset + hole_size,
- block_end,
- cur_offset, &hint_byte, 1);
+ &hint_byte, 1);
if (err)
break;
@@ -5643,7 +5636,7 @@ out_fa...
2010 Sep 02
3
[patch] O_DIRECT: fix the splitting up of contiguous I/O
...at redhat.com>
>
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 7600aac..445901c 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -632,7 +632,7 @@ static int dio_send_cur_page(struct dio *dio)
> int ret = 0;
>
> if (dio->bio) {
> - loff_t cur_offset = dio->block_in_file << dio->blkbits;
> + loff_t cur_offset = dio->cur_page_fs_offset;
> loff_t bio_next_offset = dio->logical_offset_in_bio +
> dio->bio->bi_size;
>
> @@ -657,7 +657,7 @@ static int dio_send_cur_page(struct dio *dio)
> * Submi...
2011 Feb 12
3
[PATCH] fix uncheck memory allocations
...));
em->start = start;
em->orig_start = em->start;
ram_size = ins.offset;
@@ -1169,6 +1173,7 @@ out_check:
struct extent_map_tree *em_tree;
em_tree = &BTRFS_I(inode)->extent_tree;
em = alloc_extent_map(GFP_NOFS);
+ BUG_ON(!em || IS_ERR(em));
em->start = cur_offset;
em->orig_start = em->start;
em->len = num_bytes;
--
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 majordomo info at http://vger.kernel.org/majordomo-info.html
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...action(trans, root, 1);
+ BUG_ON(ret);
}
out:
ret = 0;
@@ -955,7 +963,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
path = btrfs_alloc_path();
BUG_ON(!path);
trans = btrfs_join_transaction(root, 1);
- BUG_ON(!trans);
+ BUG_ON(IS_ERR(trans));
cow_start = (u64)-1;
cur_offset = start;
@@ -1566,6 +1574,7 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
}
trans = btrfs_join_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
if (!ordered_extent)
ordered_extent = btrfs_lookup_ordered_extent(inode, start);
@@ -1981,7 +1990,9 @@ void btr...
2011 Jul 26
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations
...t mode,
unlock_extent_cached(&BTRFS_I(inode)->io_tree, alloc_start, locked_end,
&cached_state, GFP_NOFS);
- btrfs_free_reserved_data_space(inode, alloc_end - alloc_start);
+ /*
+ * We failed to allocate some of our space, so free up part of our
+ * reservation.
+ */
+ if (cur_offset < alloc_end)
+ btrfs_free_reserved_data_space(inode, alloc_end - cur_offset);
out:
mutex_unlock(&inode->i_mutex);
return ret;
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 6377713..85bbac9 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-sp...
2011 Jul 27
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations V2
...t mode,
unlock_extent_cached(&BTRFS_I(inode)->io_tree, alloc_start, locked_end,
&cached_state, GFP_NOFS);
- btrfs_free_reserved_data_space(inode, alloc_end - alloc_start);
+ /*
+ * We failed to allocate some of our space, so free up part of our
+ * reservation.
+ */
+ if (cur_offset < alloc_end)
+ btrfs_free_reserved_data_space(inode, alloc_end - cur_offset);
out:
mutex_unlock(&inode->i_mutex);
return ret;
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 6377713..85bbac9 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-sp...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...item(trans, root, path, &key,
- datasize);
+ ret = btrfs_insert_empty_item_for_inode(trans, root, inode, path, &key,
+ datasize);
if (ret) {
err = ret;
goto fail;
@@ -1179,7 +1179,7 @@ static noinline int run_delalloc_nocow(struct inode *inode,
cow_start = (u64)-1;
cur_offset = start;
while (1) {
- ret = btrfs_lookup_file_extent(trans, root, path, ino,
+ ret = btrfs_lookup_file_extent(trans, root, path, inode,
cur_offset, 0);
if (ret < 0) {
btrfs_abort_transaction(trans, root, ret);
@@ -1812,7 +1812,8 @@ static int insert_reserved_file_extent(...
2019 Sep 03
0
[PATCH v2 07/27] drm/dp_mst: Add sideband down request tracing + selftests
..._sideband_msg_tx(struct drm_printer *p,
+ const struct drm_dp_sideband_msg_tx *txmsg)
+{
+ struct drm_dp_sideband_msg_req_body req;
+ char buf[64];
+ int ret;
+ int i;
+
+ drm_dp_mst_rad_to_str(txmsg->dst->rad, txmsg->dst->lct, buf,
+ sizeof(buf));
+ drm_printf(p, "txmsg cur_offset=%x cur_len=%x seqno=%x state=%s path_msg=%d dst=%s\n",
+ txmsg->cur_offset, txmsg->cur_len, txmsg->seqno,
+ drm_dp_mst_sideband_tx_state_str(txmsg->state),
+ txmsg->path_msg, buf);
+
+ ret = drm_dp_decode_sideband_req(txmsg, &req);
+ if (ret) {
+ drm_printf(p, &...
2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...victim_name_len);
btrfs_run_delayed_items(trans, root);
}
- BUG_ON(ret);
iput(victim_parent);
kfree(victim_name);
+ if (ret)
+ return ret;
*search_done = 1;
goto again;
}
kfree(victim_name);
- BUG_ON(ret);
+ if (ret)
+ return ret;
next:
cur_offset += victim_name_len + sizeof(*extref);
}
@@ -989,7 +1001,8 @@ next:
ref_index, name, namelen, 0);
if (di && !IS_ERR(di)) {
ret = drop_one_dir_item(trans, root, path, dir, di);
- BUG_ON(ret);
+ if (ret)
+ return ret;
}
btrfs_release_path(path);
@@ -998,7 +1011,8 @@ ne...
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
2013 Mar 16
3
crash with dovecot 2.2: Panic: Buffer full
...0x00007f9d1bfd4f84 in blocks_count_lines (full_input=0x66df90,
ctx=0x7fff684223c0) at index-mail-binary.c:319
block_idx = 0
p = <optimized out>
size = 0
data = 0x0
ret = <optimized out>
cur_block = 0x62d410
block_count = 1
cur_offset = 3944
skip = <optimized out>
#18 index_mail_read_binary_to_cache (_mail=_mail at entry=0x66fc00,
part=part at entry=0x671ed0, include_hdr=include_hdr at entry=false,
binary_r=binary_r at entry=0x7fff68422476,
converted_r=converted_r at entry=0x7fff68422477) at index-mail-binary.c:393...
2015 Jan 17
2
Changeset c02f29ca104d badly breaks LMTP/mdbox
...0}
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 0x7fffdfafeda0, reg_save_area = 0x7fffdfafece0}}
#5 0x00007f0ca3dc1d7a in mdbox_map_append_finish (ctx=0x142ac90) at mdbox-map.c:1153
appends = 0x0
last = 0x142b1d0
count = <optimized out>
cur_offset = <optimized out>
__FUNCTION__ = "mdbox_map_append_finish"
#6 0x00007f0ca3dc3d08 in mdbox_save_finish_write (_ctx=0x142ab50) at mdbox-save.c:205
_data_stack_cur_id = 6
ctx = 0x142ab50
mail = 0x142c4a0
#7 mdbox_save_finish (ctx=0x142ab50) at mdbox-sa...