Displaying 20 results from an estimated 151 matches for "btrfs_trans_handl".
Did you mean:
btrfs_trans_handle
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...AD, comp_bio, mirror_num, 0);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
bio_put(comp_bio);
return 0;
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index c3df14c..781b4ae 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -309,7 +309,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
if (btrfs_block_can_be_shared(root, buf)) {
ret = btrfs_lookup_extent_info(trans, root, buf->start,
buf->len, &refs, &flags);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
BUG_ON(refs == 0);
} else {
refs = 1;
@@ -329,14 +329,14 @@ static noinline in...
2012 Jun 21
0
[RFC PATCH V2] Btrfs: introduce extent buffer cache for each i-node
...ayed_node;
+ struct extent_buffer *fs_eb;
+ struct extent_buffer *log_eb;
+
struct inode vfs_inode;
};
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 15cbc2b..4e8c12f 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -989,6 +989,9 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
btrfs_free_tree_block(trans, root, buf, parent_start,
last_ref);
}
+
+ buf->root_objectid = 0;
+
if (unlock_orig)
btrfs_tree_unlock(buf);
free_extent_buffer_stale(buf);
@@ -1672,6 +1675,9 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
pa...
2013 Apr 25
0
[PATCH] Btrfs: remove almost all of the BUG()'s from tree-log.c
...++++++++++++++++++++++++++------------------
1 files changed, 98 insertions(+), 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 repla...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...-- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -390,10 +390,10 @@ update_existing_head_ref(struct btrfs_delayed_ref_node *existing,
* this does all the dirty work in terms of maintaining the correct
* overall modification count.
*/
-static noinline int add_delayed_ref_head(struct btrfs_trans_handle *trans,
- struct btrfs_delayed_ref_node *ref,
- u64 bytenr, u64 num_bytes,
- int action, int is_data)
+static noinline void add_delayed_ref_head(struct btrfs_trans_handle *trans,
+ struct btrfs_delayed_ref_node *ref,
+ u64 bytenr, u64 num_bytes,
+ int action, int is_d...
2012 Jul 31
0
[PATCH V2 1/2] Btrfs: fix error path in create_pending_snapshot()
...+++---------------------
1 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index b72b068..4d579fe 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -932,18 +932,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
u64 objectid;
u64 root_flags;
- rsv = trans->block_rsv;
-
new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS);
if (!new_root_item) {
ret = pending->error = -ENOMEM;
- goto fail;
+ goto root_item_alloc_fail;
}
ret = btrfs_find_free_objectid(tree_root, &o...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...btrfs_root *root,
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index fafd6f2..dbd2f13 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1456,7 +1456,6 @@ static int cleaner_kthread(void *arg)
static int transaction_kthread(void *arg)
{
struct btrfs_root *root = arg;
- struct btrfs_trans_handle *trans;
struct btrfs_transaction *cur;
unsigned long now;
unsigned long delay;
@@ -1485,8 +1484,7 @@ static int transaction_kthread(void *arg)
goto sleep;
}
mutex_unlock(&root->fs_info->trans_mutex);
- trans = btrfs_start_transaction(root, 1);
- ret = btrfs_commit_trans...
2011 Jan 28
0
[PATCH] ctree code cleanups
...search(struct extent_buffer *eb, struct btrfs_key *key,
- int level, int *slot)
-{
- return 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;...
2013 Mar 15
0
[PATCH] Btrfs-progs: add skinny metadata support to progs V3
...i = btrfs_item_ptr(leaf, path->slots[0],
diff --git a/btrfstune.c b/btrfstune.c
index 6e68bda..74ee8eb 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -81,11 +81,28 @@ int enable_extrefs_flag(struct btrfs_root *root)
return 0;
}
+int enable_skinny_metadata(struct btrfs_root *root)
+{
+ struct btrfs_trans_handle *trans;
+ struct btrfs_super_block *disk_super;
+ u64 super_flags;
+
+ disk_super = &root->fs_info->super_copy;
+ super_flags = btrfs_super_incompat_flags(disk_super);
+ super_flags |= BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA;
+ trans = btrfs_start_transaction(root, 1);
+ btrfs_set_super_i...
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
2012 Sep 06
2
[PATCH V4 01/12] Btrfs: fix error path in create_pending_snapshot()
...----------------------
1 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 3ee8d58..b259d22f2 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -962,18 +962,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
u64 root_flags;
uuid_le new_uuid;
- rsv = trans->block_rsv;
-
new_root_item = kmalloc(sizeof(*new_root_item), GFP_NOFS);
if (!new_root_item) {
ret = pending->error = -ENOMEM;
- goto fail;
+ goto root_item_alloc_fail;
}
ret = btrfs_find_free_objectid(tree_root, &a...
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
2009 May 12
0
[PATCH 1/2] btrfs-progs: mixed back ref support
...eration(buf) > trans->transid);
- ret = btrfs_inc_ref(trans, new_root, buf, cow, NULL);
+ ret = btrfs_inc_ref(trans, new_root, cow, 0);
kfree(new_root);
if (ret)
@@ -128,6 +133,74 @@ int btrfs_copy_root(struct btrfs_trans_h
return 0;
}
+static noinline int __btrfs_update_ref(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ struct extent_buffer *buf,
+ struct extent_buffer *cow)
+{
+ u64 refs;
+ u64 owner;
+ u64 flags;
+ u64 new_flags;
+ int ret;
+
+ owner = btrfs_header_owner(buf);
+ BUG_ON(owner == BTRFS_TREE_RELOC_OBJECTID);
+ /*
+ * There are onl...
2013 Apr 25
10
[PATCH v4 0/3] Btrfs: quota rescan for 3.10
The kernel side for rescan, which is needed if you want to enable qgroup
tracking on a non-empty volume. The first patch splits
btrfs_qgroup_account_ref into readable ans reusable units. The second
patch adds the rescan implementation (refer to its commit message for a
description of the algorithm). The third patch starts an automatic
rescan when qgroups are enabled. It is only separated to
2013 Jan 10
0
[PATCH 03/11] Btrfs: use atomic for fs_info->last_trans_log_full_commit
...log_full_commit;
unsigned long mount_opt;
unsigned long compress_type:4;
u64 max_inline;
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2d9fe27..a302e3a 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7894,7 +7894,8 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
extent_root = root->fs_info->extent_root;
- root->fs_info->last_trans_log_full_commit = trans->transid;
+ atomic64_set(&root->fs_info->last_trans_log_full_commit,
+ trans->transid);
cache = kzalloc(sizeof(*cache), GFP_NOFS);
if (!cache)
diff --...
2013 Jan 10
0
[PATCH 02/11] Btrfs: use atomic for fs_info->last_trans_committed
...>fs_info->last_trans_committed);
goto out;
}
transid = trans->transid;
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index f107312..f376621 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -975,7 +975,7 @@ void btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
* if this file hasn''t been changed since the last transaction
* commit, we can safely return without doing anything
*/
- if (last_mod < root->fs_info->last_trans_committed)
+ if (last_mod < atomic64_read(&root->fs_info->last_trans_committed))
retu...
2013 Mar 04
2
[PATCH 1/2] Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails
...ctual creation.
+ *
+ * Note:
+ * If the error which may affect the commitment of the current transaction
+ * happens, we should return the error number. If the error which just affect
+ * the creation of the pending snapshots, just return 0.
*/
static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info,
@@ -1072,7 +1077,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
struct extent_buffer *tmp;
struct extent_buffer *old;
struct timespec cur_time = CURRENT_TIME;
- int ret;
+ int ret = 0;
u64 to_reserve = 0;...
2008 Jun 24
1
[RFC][PATCH] btrfs orphan code
...ODE_ITEM_KEY 1
#define BTRFS_INODE_REF_KEY 2
#define BTRFS_XATTR_ITEM_KEY 8
+#define BTRFS_ORPHAN_DIR_ITEM_KEY 9
/* reserve 2-15 close to the inode for later flexibility */
/*
@@ -1485,7 +1491,7 @@ int btrfs_find_dead_roots(struct btrfs_r
/* dir-item.c */
int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
*root, const char *name, int name_len, u64 dir,
- struct btrfs_key *location, u8 type);
+ struct btrfs_key *location, u8 type, int index);
struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root,...
2012 May 27
0
[RFC PATCH] Decrease Metadata Fragment Using A Caterpillar Band Method
..., u32 blocksize,
u64 parent, u64 root_objectid,
struct btrfs_disk_key *key, int level,
+ u64 hint, u64 empty_size, int for_cow);
+int btrfs_cater_blocks_free(struct btrfs_root *root, u64 start, u64 len,
+ u8 factor, u8 index);
+struct extent_buffer *btrfs_grab_cater_block(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, struct extent_buffer *buf,
+ u64 parent, u64 root_objectid,
+ struct btrfs_disk_key *key, int level,
+ u64 hint, u64 empty_size, int for_cow);
+struct extent_buffer *btrfs_alloc_free_block_cater(
+ struct btrfs_trans_handle *trans,
+ struc...
2013 May 22
0
[PATCH 1/2] Btrfs: dont do log_removal in insert_new_root
...bo.li.liu@oracle.com>
---
fs/btrfs/ctree.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/ctree.c b/fs/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...
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