]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Btrfs: remove unnecessary memory barrier in btrfs_sync_log()
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 20 Feb 2014 10:08:55 +0000 (18:08 +0800)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:16:41 +0000 (15:16 -0400)
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>
fs/btrfs/tree-log.c

index ca960ad271fe908a294d91b0e3b30f306c89c208..285c168391f3eb58ff8635266af22d6371d801ca 100644 (file)
@@ -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
@@ -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);
 
        /*