mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com>
Subject: [PATCH 2/4] f2fs: no need to call ktime_get_real_seconds() if iostat is not enabled
Date: Wed,  4 Jan 2023 19:21:56 +0800	[thread overview]
Message-ID: <20230104112158.15844-2-frank.li@vivo.com> (raw)
In-Reply-To: <20230104112158.15844-1-frank.li@vivo.com>

When the iostat is not enabled, it is meaningless to call
ktime_get_real_seconds() to assign values to variables.

Let's put the call to the ktime_get_real_seconds() after iostat is enabled.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/f2fs/iostat.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c
index 8460989e9bab..e7d03c446994 100644
--- a/fs/f2fs/iostat.c
+++ b/fs/f2fs/iostat.c
@@ -29,12 +29,11 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
 {
 	struct super_block *sb = seq->private;
 	struct f2fs_sb_info *sbi = F2FS_SB(sb);
-	time64_t now = ktime_get_real_seconds();
 
 	if (!sbi->iostat_enable)
 		return 0;
 
-	seq_printf(seq, "time:		%-16llu\n", now);
+	seq_printf(seq, "time:		%-16llu\n", ktime_get_real_seconds());
 	seq_printf(seq, "\t\t\t%-16s %-16s %-16s\n",
 				"io_bytes", "count", "avg_bytes");
 
-- 
2.25.1


  reply	other threads:[~2023-01-04 11:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 11:21 [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat() Yangtao Li
2023-01-04 11:21 ` Yangtao Li [this message]
2023-01-04 11:21 ` [PATCH 3/4] f2fs: introduce IOSTAT_INFO_SHOW macro Yangtao Li
2023-01-04 11:21 ` [PATCH 4/4] f2fs: rename rw_iostat to iostat_bytes Yangtao Li
2023-01-04 19:20 ` [PATCH 1/4] f2fs: reset iostat_count in f2fs_reset_iostat() Jaegeuk Kim
2023-01-11 14:06   ` Chao Yu
2023-01-11 19:17     ` Jaegeuk Kim
2023-01-12 15:13       ` Yangtao Li
2023-01-12 23:59         ` Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230104112158.15844-2-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®