Skip to content

Commit

Permalink
Btrfs: remove unnecessary memory barrier in btrfs_sync_log()
Browse files Browse the repository at this point in the history
Mutex unlock implies certain memory barriers to make sure all the memory
operation completes before the unlock, and the next mutex lock implies memory
barriers to make sure the all the memory happens after the lock. So it is
a full memory barrier(smp_mb), we needn't add memory barriers. Remove them.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
  • Loading branch information
Miao Xie authored and Josef Bacik committed Mar 10, 2014
1 parent e87ac13 commit 7483e1a
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
root->log_transid++;
log->log_transid = root->log_transid;
root->log_start_pid = 0;
smp_mb();
/*
* IO has been started, blocks of the log tree have WRITTEN flag set
* in their headers. new modifications of the log will be written to
Expand Down Expand Up @@ -2589,8 +2588,6 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
btrfs_header_level(log_root_tree->node));

log_root_tree->log_transid++;
smp_mb();

mutex_unlock(&log_root_tree->log_mutex);

/*
Expand Down

0 comments on commit 7483e1a

Please sign in to comment.