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 1/2] f2fs_io: support fadvise dontneed, random, and noreuse
Date: Thu, 13 Feb 2025 18:01:40 +0000 [thread overview]
Message-ID: <20250213180142.1366047-1-jaegeuk@kernel.org> (raw)
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
tools/f2fs_io/f2fs_io.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index fa01f8fd4809..e7ad22e08ba5 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -441,7 +441,10 @@ static void do_shutdown(int argc, char **argv, const struct cmd_desc *cmd)
"fadvice given the file\n" \
"advice can be\n" \
" willneed\n" \
+" dontneed\n" \
+" noreuse\n" \
" sequential\n" \
+" random\n" \
static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -458,8 +461,14 @@ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd)
if (!strcmp(argv[1], "willneed")) {
advice = POSIX_FADV_WILLNEED;
+ } else if (!strcmp(argv[1], "dontneed")) {
+ advice = POSIX_FADV_DONTNEED;
+ } else if (!strcmp(argv[1], "noreuse")) {
+ advice = POSIX_FADV_NOREUSE;
} else if (!strcmp(argv[1], "sequential")) {
advice = POSIX_FADV_SEQUENTIAL;
+ } else if (!strcmp(argv[1], "random")) {
+ advice = POSIX_FADV_RANDOM;
} else {
fputs("Wrong advice\n\n", stderr);
fputs(cmd->cmd_help, stderr);
--
2.48.1.601.g30ceb7b040-goog
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2025-02-13 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 18:01 Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-02-13 18:01 ` [f2fs-dev] [PATCH 2/2] f2fs_io: add ioprio command to give a io priority hint Jaegeuk Kim via Linux-f2fs-devel
-- strict thread matches above, loose matches on Subject: below --
2025-02-28 19:08 [f2fs-dev] [PATCH 1/2] f2fs_io: support fadvise dontneed, random, and noreuse Jaegeuk Kim via Linux-f2fs-devel
2025-03-03 3:17 ` 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=20250213180142.1366047-1-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.