summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index dc030f620be1..75a8e3c78fdb 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3096,7 +3096,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
3096 if (ret) { 3096 if (ret) {
3097 blk_finish_plug(&plug); 3097 blk_finish_plug(&plug);
3098 btrfs_abort_transaction(trans, ret); 3098 btrfs_abort_transaction(trans, ret);
3099 btrfs_set_log_full_commit(fs_info, trans); 3099 btrfs_set_log_full_commit(trans);
3100 mutex_unlock(&root->log_mutex); 3100 mutex_unlock(&root->log_mutex);
3101 goto out; 3101 goto out;
3102 } 3102 }
@@ -3138,7 +3138,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
3138 list_del_init(&root_log_ctx.list); 3138 list_del_init(&root_log_ctx.list);
3139 3139
3140 blk_finish_plug(&plug); 3140 blk_finish_plug(&plug);
3141 btrfs_set_log_full_commit(fs_info, trans); 3141 btrfs_set_log_full_commit(trans);
3142 3142
3143 if (ret != -ENOSPC) { 3143 if (ret != -ENOSPC) {
3144 btrfs_abort_transaction(trans, ret); 3144 btrfs_abort_transaction(trans, ret);
@@ -3197,7 +3197,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
3197 EXTENT_DIRTY | EXTENT_NEW); 3197 EXTENT_DIRTY | EXTENT_NEW);
3198 blk_finish_plug(&plug); 3198 blk_finish_plug(&plug);
3199 if (ret) { 3199 if (ret) {
3200 btrfs_set_log_full_commit(fs_info, trans); 3200 btrfs_set_log_full_commit(trans);
3201 btrfs_abort_transaction(trans, ret); 3201 btrfs_abort_transaction(trans, ret);
3202 mutex_unlock(&log_root_tree->log_mutex); 3202 mutex_unlock(&log_root_tree->log_mutex);
3203 goto out_wake_log_root; 3203 goto out_wake_log_root;
@@ -3207,7 +3207,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
3207 ret = btrfs_wait_tree_log_extents(log_root_tree, 3207 ret = btrfs_wait_tree_log_extents(log_root_tree,
3208 EXTENT_NEW | EXTENT_DIRTY); 3208 EXTENT_NEW | EXTENT_DIRTY);
3209 if (ret) { 3209 if (ret) {
3210 btrfs_set_log_full_commit(fs_info, trans); 3210 btrfs_set_log_full_commit(trans);
3211 mutex_unlock(&log_root_tree->log_mutex); 3211 mutex_unlock(&log_root_tree->log_mutex);
3212 goto out_wake_log_root; 3212 goto out_wake_log_root;
3213 } 3213 }
@@ -3229,7 +3229,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
3229 */ 3229 */
3230 ret = write_all_supers(fs_info, 1); 3230 ret = write_all_supers(fs_info, 1);
3231 if (ret) { 3231 if (ret) {
3232 btrfs_set_log_full_commit(fs_info, trans); 3232 btrfs_set_log_full_commit(trans);
3233 btrfs_abort_transaction(trans, ret); 3233 btrfs_abort_transaction(trans, ret);
3234 goto out_wake_log_root; 3234 goto out_wake_log_root;
3235 } 3235 }
@@ -3433,7 +3433,7 @@ fail:
3433out_unlock: 3433out_unlock:
3434 mutex_unlock(&dir->log_mutex); 3434 mutex_unlock(&dir->log_mutex);
3435 if (ret == -ENOSPC) { 3435 if (ret == -ENOSPC) {
3436 btrfs_set_log_full_commit(root->fs_info, trans); 3436 btrfs_set_log_full_commit(trans);
3437 ret = 0; 3437 ret = 0;
3438 } else if (ret < 0) 3438 } else if (ret < 0)
3439 btrfs_abort_transaction(trans, ret); 3439 btrfs_abort_transaction(trans, ret);
@@ -3449,7 +3449,6 @@ int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
3449 const char *name, int name_len, 3449 const char *name, int name_len,
3450 struct btrfs_inode *inode, u64 dirid) 3450 struct btrfs_inode *inode, u64 dirid)
3451{ 3451{
3452 struct btrfs_fs_info *fs_info = root->fs_info;
3453 struct btrfs_root *log; 3452 struct btrfs_root *log;
3454 u64 index; 3453 u64 index;
3455 int ret; 3454 int ret;
@@ -3467,7 +3466,7 @@ int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
3467 dirid, &index); 3466 dirid, &index);
3468 mutex_unlock(&inode->log_mutex); 3467 mutex_unlock(&inode->log_mutex);
3469 if (ret == -ENOSPC) { 3468 if (ret == -ENOSPC) {
3470 btrfs_set_log_full_commit(fs_info, trans); 3469 btrfs_set_log_full_commit(trans);
3471 ret = 0; 3470 ret = 0;
3472 } else if (ret < 0 && ret != -ENOENT) 3471 } else if (ret < 0 && ret != -ENOENT)
3473 btrfs_abort_transaction(trans, ret); 3472 btrfs_abort_transaction(trans, ret);
@@ -5453,7 +5452,7 @@ static bool btrfs_must_commit_transaction(struct btrfs_trans_handle *trans,
5453 * Make sure any commits to the log are forced to be full 5452 * Make sure any commits to the log are forced to be full
5454 * commits. 5453 * commits.
5455 */ 5454 */
5456 btrfs_set_log_full_commit(fs_info, trans); 5455 btrfs_set_log_full_commit(trans);
5457 ret = true; 5456 ret = true;
5458 } 5457 }
5459 mutex_unlock(&inode->log_mutex); 5458 mutex_unlock(&inode->log_mutex);
@@ -6006,7 +6005,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
6006end_trans: 6005end_trans:
6007 dput(old_parent); 6006 dput(old_parent);
6008 if (ret < 0) { 6007 if (ret < 0) {
6009 btrfs_set_log_full_commit(fs_info, trans); 6008 btrfs_set_log_full_commit(trans);
6010 ret = 1; 6009 ret = 1;
6011 } 6010 }
6012 6011