* [f2fs-dev] [PATCH] f2fs_io: support unset subcommand for pinfile
@ 2024-03-29 10:25 Chao Yu
2024-04-10 3:24 ` Chao Yu
0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2024-03-29 10:25 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-f2fs-devel
This patch adds unset subcommand for pinfile command.
Usage: f2fs_io pinfile unset [target_file]
Signed-off-by: Chao Yu <chao@kernel.org>
---
man/f2fs_io.8 | 2 +-
tools/f2fs_io/f2fs_io.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/man/f2fs_io.8 b/man/f2fs_io.8
index f097bde..b9c9dc8 100644
--- a/man/f2fs_io.8
+++ b/man/f2fs_io.8
@@ -44,7 +44,7 @@ going down with metadata flush
going down with fsck mark
.RE
.TP
-\fBpinfile\fR \fI[get|set] [file]\fR
+\fBpinfile\fR \fI[get|set|unset] [file]\fR
Get or set the pinning status on a file.
.TP
\fBfadvise\fR \fI[advice] [offset] [length] [file]\fR
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index b8e4f02..a7b593a 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -442,7 +442,7 @@ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd)
#define pinfile_desc "pin file control"
#define pinfile_help \
-"f2fs_io pinfile [get|set] [file]\n\n" \
+"f2fs_io pinfile [get|set|unset] [file]\n\n" \
"get/set pinning given the file\n" \
static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
@@ -464,7 +464,14 @@ static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
if (ret != 0)
die_errno("F2FS_IOC_SET_PIN_FILE failed");
- printf("set_pin_file: %u blocks moved in %s\n", ret, argv[2]);
+ printf("%s pinfile: %u blocks moved in %s\n",
+ argv[1], ret, argv[2]);
+ } else if (!strcmp(argv[1], "unset")) {
+ pin = 0;
+ ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
+ if (ret != 0)
+ die_errno("F2FS_IOC_SET_PIN_FILE failed");
+ printf("%s pinfile in %s\n", argv[1], argv[2]);
} else if (!strcmp(argv[1], "get")) {
unsigned int flags;
--
2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs_io: support unset subcommand for pinfile
2024-03-29 10:25 [f2fs-dev] [PATCH] f2fs_io: support unset subcommand for pinfile Chao Yu
@ 2024-04-10 3:24 ` Chao Yu
2024-04-10 17:55 ` Daeho Jeong
0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2024-04-10 3:24 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-f2fs-devel
Ping,
Missed to check this patch?
On 2024/3/29 18:25, Chao Yu wrote:
> This patch adds unset subcommand for pinfile command.
>
> Usage: f2fs_io pinfile unset [target_file]
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> man/f2fs_io.8 | 2 +-
> tools/f2fs_io/f2fs_io.c | 11 +++++++++--
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/man/f2fs_io.8 b/man/f2fs_io.8
> index f097bde..b9c9dc8 100644
> --- a/man/f2fs_io.8
> +++ b/man/f2fs_io.8
> @@ -44,7 +44,7 @@ going down with metadata flush
> going down with fsck mark
> .RE
> .TP
> -\fBpinfile\fR \fI[get|set] [file]\fR
> +\fBpinfile\fR \fI[get|set|unset] [file]\fR
> Get or set the pinning status on a file.
> .TP
> \fBfadvise\fR \fI[advice] [offset] [length] [file]\fR
> diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> index b8e4f02..a7b593a 100644
> --- a/tools/f2fs_io/f2fs_io.c
> +++ b/tools/f2fs_io/f2fs_io.c
> @@ -442,7 +442,7 @@ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd)
>
> #define pinfile_desc "pin file control"
> #define pinfile_help \
> -"f2fs_io pinfile [get|set] [file]\n\n" \
> +"f2fs_io pinfile [get|set|unset] [file]\n\n" \
> "get/set pinning given the file\n" \
>
> static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
> @@ -464,7 +464,14 @@ static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
> ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
> if (ret != 0)
> die_errno("F2FS_IOC_SET_PIN_FILE failed");
> - printf("set_pin_file: %u blocks moved in %s\n", ret, argv[2]);
> + printf("%s pinfile: %u blocks moved in %s\n",
> + argv[1], ret, argv[2]);
> + } else if (!strcmp(argv[1], "unset")) {
> + pin = 0;
> + ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
> + if (ret != 0)
> + die_errno("F2FS_IOC_SET_PIN_FILE failed");
> + printf("%s pinfile in %s\n", argv[1], argv[2]);
> } else if (!strcmp(argv[1], "get")) {
> unsigned int flags;
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs_io: support unset subcommand for pinfile
2024-04-10 3:24 ` Chao Yu
@ 2024-04-10 17:55 ` Daeho Jeong
0 siblings, 0 replies; 3+ messages in thread
From: Daeho Jeong @ 2024-04-10 17:55 UTC (permalink / raw)
To: Chao Yu; +Cc: jaegeuk, linux-f2fs-devel
On Tue, Apr 9, 2024 at 8:27 PM Chao Yu <chao@kernel.org> wrote:
>
> Ping,
>
> Missed to check this patch?
>
> On 2024/3/29 18:25, Chao Yu wrote:
> > This patch adds unset subcommand for pinfile command.
> >
> > Usage: f2fs_io pinfile unset [target_file]
> >
> > Signed-off-by: Chao Yu <chao@kernel.org>
> > ---
> > man/f2fs_io.8 | 2 +-
> > tools/f2fs_io/f2fs_io.c | 11 +++++++++--
> > 2 files changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/man/f2fs_io.8 b/man/f2fs_io.8
> > index f097bde..b9c9dc8 100644
> > --- a/man/f2fs_io.8
> > +++ b/man/f2fs_io.8
> > @@ -44,7 +44,7 @@ going down with metadata flush
> > going down with fsck mark
> > .RE
> > .TP
> > -\fBpinfile\fR \fI[get|set] [file]\fR
> > +\fBpinfile\fR \fI[get|set|unset] [file]\fR
> > Get or set the pinning status on a file.
> > .TP
> > \fBfadvise\fR \fI[advice] [offset] [length] [file]\fR
> > diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> > index b8e4f02..a7b593a 100644
> > --- a/tools/f2fs_io/f2fs_io.c
> > +++ b/tools/f2fs_io/f2fs_io.c
> > @@ -442,7 +442,7 @@ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd)
> >
> > #define pinfile_desc "pin file control"
> > #define pinfile_help \
> > -"f2fs_io pinfile [get|set] [file]\n\n" \
> > +"f2fs_io pinfile [get|set|unset] [file]\n\n" \
> > "get/set pinning given the file\n" \
> >
> > static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
> > @@ -464,7 +464,14 @@ static void do_pinfile(int argc, char **argv, const struct cmd_desc *cmd)
> > ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
> > if (ret != 0)
> > die_errno("F2FS_IOC_SET_PIN_FILE failed");
> > - printf("set_pin_file: %u blocks moved in %s\n", ret, argv[2]);
> > + printf("%s pinfile: %u blocks moved in %s\n",
> > + argv[1], ret, argv[2]);
> > + } else if (!strcmp(argv[1], "unset")) {
> > + pin = 0;
> > + ret = ioctl(fd, F2FS_IOC_SET_PIN_FILE, &pin);
> > + if (ret != 0)
> > + die_errno("F2FS_IOC_SET_PIN_FILE failed");
> > + printf("%s pinfile in %s\n", argv[1], argv[2]);
> > } else if (!strcmp(argv[1], "get")) {
> > unsigned int flags;
> >
>
Reviewed-by: Daeho Jeong <daehojeong@google.com>
Thanks,
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-10 17:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 10:25 [f2fs-dev] [PATCH] f2fs_io: support unset subcommand for pinfile Chao Yu
2024-04-10 3:24 ` Chao Yu
2024-04-10 17:55 ` Daeho Jeong
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.