All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH 3/3] f2fs_io: rename mlock to fadvise
Date: Mon,  1 Dec 2025 20:46:20 +0000	[thread overview]
Message-ID: <20251201204620.905318-3-jaegeuk@kernel.org> (raw)
In-Reply-To: <20251201204620.905318-1-jaegeuk@kernel.org>

fadvise is better to describe the read method.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 tools/f2fs_io/f2fs_io.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index d5e103f7b833..35c367bd67e7 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -939,7 +939,7 @@ static void do_write_advice(int argc, char **argv, const struct cmd_desc *cmd)
 "  dio      : direct IO\n"				\
 "  mmap     : mmap IO\n"				\
 "  madvise  : mmap + mlock2 + madvise\n"		\
-"  mlock    : mmap + mlock\n"				\
+"  fadvise  : mmap + fadvise + mlock\n"			\
 "advice can be\n"					\
 " 1 : set sequential|willneed\n"			\
 " 0 : none\n"						\
@@ -956,7 +956,7 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 	u64 mlock_time_start = 0, mlock_time_end = 0;
 	int flags = 0;
 	int do_mmap = 0;
-	int do_mlock = 0;
+	int do_fadvise = 0;
 	int do_madvise = 0;
 	int do_dontcache = 0;
 	int fd, advice;
@@ -983,8 +983,8 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 		do_mmap = 1;
 	else if (!strcmp(argv[4], "madvise"))
 		do_madvise = 1;
-	else if (!strcmp(argv[4], "mlock"))
-		do_mlock = 1;
+	else if (!strcmp(argv[4], "fadvise"))
+		do_fadvise = 1;
 	else if (!strcmp(argv[4], "dontcache"))
 #ifdef HAVE_PREADV2
 		do_dontcache = 1;
@@ -1045,7 +1045,7 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 
 		read_cnt = count * buf_size;
 		memcpy(print_buf, data, print_bytes);
-	} else if (do_mlock) {
+	} else if (do_fadvise) {
 		data = mmap(NULL, count * buf_size, PROT_READ,
 				MAP_SHARED, fd, offset);
 		if (data == MAP_FAILED)
@@ -1107,7 +1107,7 @@ static void do_read(int argc, char **argv, const struct cmd_desc *cmd)
 	}
 	if (do_mmap) {
 		munmap(data, count * buf_size);
-	} else if (do_mlock || do_madvise) {
+	} else if (do_fadvise || do_madvise) {
 		munlock(data, count * buf_size);
 		munmap(data, count * buf_size);
 	}
-- 
2.52.0.107.ga0afd4fd5b-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  parent reply	other threads:[~2025-12-01 20:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 20:46 [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly Jaegeuk Kim via Linux-f2fs-devel
2025-12-01 20:46 ` [f2fs-dev] [PATCH 2/3] f2fs_io: add read test with mlock2 and madvise Jaegeuk Kim via Linux-f2fs-devel
2025-12-01 21:29   ` Chao Yu via Linux-f2fs-devel
2025-12-01 20:46 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-12-01 21:30   ` [f2fs-dev] [PATCH 3/3] f2fs_io: rename mlock to fadvise Chao Yu via Linux-f2fs-devel
2025-12-01 21:25 ` [f2fs-dev] [PATCH 1/3] f2fs_io: measure the start time explicitly Chao Yu via Linux-f2fs-devel

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=20251201204620.905318-3-jaegeuk@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=jaegeuk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.