Linux Kernels

btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()

This change “btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()” (commit dc1a90c) in Linux kernel is authored by Wang Xiaoguang <wangxg.fnst [at] cn.fujitsu.com> on Wed Oct 26 15:23:01 2016 +0800.

Description of "btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()"

The change “btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()” introduces changes as follows.

btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

Linux kernel releases containing commit dc1a90c

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "btrfs: cleanup: use already calculated value in btrfs_should_throttle_delayed_refs()"

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/btrfs/extent-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 87ad2ebcac62..62b6e2023e12 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2826,7 +2826,7 @@ int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans,
 	smp_mb();
 	avg_runtime = fs_info->avg_delayed_ref_runtime;
 	val = num_entries * avg_runtime;
-	if (num_entries * avg_runtime >= NSEC_PER_SEC)
+	if (val >= NSEC_PER_SEC)
 		return 1;
 	if (val >= NSEC_PER_SEC / 2)
 		return 2;

The commit for this change in Linux stable tree is dc1a90c (patch).

Last modified: 2020/01/11 06:51