search for: cur_tran

Displaying 15 results from an estimated 15 matches for "cur_tran".

Did you mean: cur_trans
2007 Aug 09
1
[RFC] All my fsync changes
...e(&root->fs_info->transaction_map_radix, + (unsigned long)transaction->transid); memset(transaction, 0, sizeof(*transaction)); kmem_cache_free(btrfs_transaction_cachep, transaction); } @@ -49,13 +52,15 @@ static int join_transaction(struct btrfs struct btrfs_transaction *cur_trans; cur_trans = root->fs_info->running_transaction; if (!cur_trans) { + int ret; cur_trans = kmem_cache_alloc(btrfs_transaction_cachep, GFP_NOFS); total_trans++; BUG_ON(!cur_trans); root->fs_info->generation++; root->fs_info->running_transaction = cur_...
2010 Oct 26
0
[PATCH v2] Btrfs: fix deadlock in btrfs_commit_transaction
...1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 66e4c66..b461fe3 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -392,6 +392,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, WARN_ON(cur_trans->num_writers < 1); cur_trans->num_writers--; + smp_mb(); if (waitqueue_active(&cur_trans->writer_wait)) wake_up(&cur_trans->writer_wait); put_transaction(cur_trans); @@ -992,7 +993,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, struct...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...* root->leafsize) + + (num_bytes * ((BTRFS_MAX_LEVEL - 1) * 2)) * root->nodesize; + + return num_bytes; +} + /* * either allocate a new transaction or hop into the existing one */ @@ -54,6 +82,8 @@ static noinline int join_transaction(struct btrfs_root *root) struct btrfs_transaction *cur_trans; cur_trans = root->fs_info->running_transaction; if (!cur_trans) { + u64 root_bytes = calculate_bytes_needed(root, 6); + cur_trans = kmem_cache_alloc(btrfs_transaction_cachep, GFP_NOFS); BUG_ON(!cur_trans); @@ -67,6 +97,7 @@ static noinline int join_transaction(struct b...
2013 Mar 04
2
[PATCH 1/2] Btrfs: fix wrong handle at error path of create_snapshot() when the commit fails
...ion *t) snapshot = list_entry(splice.next, struct btrfs_pending_snapshot, list); - + snapshot->error = -ECANCELED; list_del_init(&snapshot->list); - - kfree(snapshot); } } @@ -3840,6 +3838,8 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, cur_trans->blocked = 1; wake_up(&root->fs_info->transaction_blocked_wait); + btrfs_evict_pending_snapshots(cur_trans); + cur_trans->blocked = 0; wake_up(&root->fs_info->transaction_wait); @@ -3849,8 +3849,6 @@ void btrfs_cleanup_one_transaction(struct btrfs_t...
2010 Oct 25
14
[PATCH 0/6] Btrfs commit fixes, async subvol operations
Hi Chris, This is the extent of my current queue of Btrfs snapshot/subvol/commit stuff. Most of these were posted several months ago. Can be sent upstream during this merge window? Not having this functionality is becoming a bit of a roadblock for our efforts to keep the Ceph data in a consistent state. These patches are also available from
2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...p linux-2.6.38/fs/btrfs/transaction.c linux-2.6.38.new/fs/btrfs/transaction.c --- linux-2.6.38/fs/btrfs/transaction.c 2011-03-15 10:20:32.000000000 +0900 +++ linux-2.6.38.new/fs/btrfs/transaction.c 2011-03-23 11:28:09.000000000 +0900 @@ -57,7 +57,8 @@ static noinline int join_transaction(str if (!cur_trans) { cur_trans = kmem_cache_alloc(btrfs_transaction_cachep, GFP_NOFS); - BUG_ON(!cur_trans); + if (!cur_trans) + return -ENOMEM; root->fs_info->generation++; cur_trans->num_writers = 1; cur_trans->num_joined = 0; @@ -195,7 +196,11 @@ again: wait_current_tran...
2010 Mar 22
5
[PATCH 0/5] asynchronous commit, snapshot ponies
Hi everyone, This patchset is the latest approach I''m using for the Ceph storage daemon to keep track of which data has safely committed to disk. The basic idea is to not use the (problematic) user transaction ioctls at all. Instead, the daemon quiesces its own write requests, initiates an async snapshot, and then continues. The snapshot approach is nice because it provides rollback.
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...struct btrfs_root *root) +{ + int ret; + ret = btrfs_block_rsv_check(trans, root, + &root->fs_info->global_block_rsv, 0, 5); + return ret ? 1 : 0; +} + +int btrfs_should_end_transaction(struct btrfs_trans_handle *trans, + struct btrfs_root *root) +{ + struct btrfs_transaction *cur_trans = trans->transaction; + int updates; + + if (cur_trans->blocked || cur_trans->delayed_refs.flushing) + return 1; + + updates = trans->delayed_ref_updates; + trans->delayed_ref_updates = 0; + if (updates) + btrfs_run_delayed_refs(trans, root, updates); + + return should_end_transac...
2013 Jan 10
0
[PATCH 02/11] Btrfs: use atomic for fs_info->last_trans_committed
...0; if (transid) { - if (transid <= root->fs_info->last_trans_committed) + if (transid <= + atomic64_read(&root->fs_info->last_trans_committed)) goto out; ret = -EINVAL; @@ -1713,7 +1714,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, cur_trans->commit_done = 1; - root->fs_info->last_trans_committed = cur_trans->transid; + atomic64_set(&root->fs_info->last_trans_committed, cur_trans->transid); wake_up(&cur_trans->commit_wait); diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 83186c7..e6...
2011 Jun 21
19
[GIT PULL v3] Btrfs: improve write ahead log with sub transaction
...formance improvement: in my sysbench "write + fsync" test: 451.01Kb/sec -> 4.3621Mb/sec In v2, thanks to Chris, we worked together to solve 2 bugs, and after that it works as expected. Since there are some vital changes in recent rc, like "kill trans_mutex" and "use cur_trans", as David asked, 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...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...ret); } } diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 66e4c66..8af7081 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -191,7 +191,7 @@ again: wait_current_trans(root); ret = join_transaction(root); - BUG_ON(ret); + btrfs_fixable_bug_on(ret); cur_trans = root->fs_info->running_transaction; cur_trans->use_count++; @@ -586,11 +586,11 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans, ret = btrfs_update_root(trans, tree_root, &root->root_key, &root->root_item); - BUG_ON(ret); + btrfs_fixabl...
2012 Aug 24
4
[PATCH] Btrfs: pass lockdep rwsem metadata to async commit transaction
...acquire_read( + &ac->root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], + 0, 1, _THIS_IP_); + btrfs_commit_transaction(ac->newtrans, ac->root); kfree(ac); } @@ -1257,6 +1265,14 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, atomic_inc(&cur_trans->use_count); btrfs_end_transaction(trans, root); + + /* + * Tell lockdep we''ve released the freeze rwsem, since the + * async commit thread will be the one to unlock it. + */ + rwsem_release(&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], + 1, _THIS_I...
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
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
2011 Mar 08
6
[PATCH v1 0/6] btrfs: scrub
This series adds an initial implementation for scrub. It works quite straightforward. The usermode issues an ioctl for each device in the fs. For each device, it enumerates the allocated device chunks. For each chunk, the contained extents are enumerated and the data checksums fetched. The extents are read sequentially and the checksums verified. If an error occurs (checksum or EIO), a good copy