Message ID | 20161025105607.17476-1-wangxg.fnst@cn.fujitsu.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
On Tue, Oct 25, 2016 at 06:56:07PM +0800, Wang Xiaoguang wrote: > Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> > --- > V1: Just one small codes cleanup, if you think it's not appropriate to > make a individual patch for it, please ignore it :) No, that's fine, cleanups are welcome. The subject line could be improved though, describe what's been cleaned up, eg. "cleanup, use already calculated value". We could have tons of patches called minor cleanups", but this makes searching and processing patches less pleasant for me. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9aa6d2c..3c8f0ec 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -2823,7 +2823,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;
Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> --- V1: Just one small codes cleanup, if you think it's not appropriate to make a individual patch for it, please ignore it :) --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)