From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/3] f2fs_io: add fsync
Date: Wed, 6 May 2020 07:39:45 -0700 [thread overview]
Message-ID: <20200506143945.GA107238@google.com> (raw)
In-Reply-To: <66e59a2f-c877-6952-cae6-645ba18f9f75@huawei.com>
On 05/06, Chao Yu wrote:
> On 2020/5/2 8:29, Jaegeuk Kim wrote:
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> > tools/f2fs_io/f2fs_io.c | 25 +++++++++++++++++++++++++
> > 1 file changed, 25 insertions(+)
> >
> > diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> > index c1edef1..c84b6ab 100644
> > --- a/tools/f2fs_io/f2fs_io.c
> > +++ b/tools/f2fs_io/f2fs_io.c
> > @@ -130,6 +130,30 @@ static void full_write(int fd, const void *buf, size_t count)
> > }
> > }
> >
> > +#define fsync_desc "fsync"
> > +#define fsync_help \
> > +"f2fs_io fsync [file]\n\n" \
>
> What about supporting fdatasync via an additional argument here?
I prefer to add another command "fdatasync" for simplicity. :P
>
> > +"fsync given the file\n" \
> > +
> > +static void do_fsync(int argc, char **argv, const struct cmd_desc *cmd)
> > +{
> > + int fd;
> > +
> > + if (argc != 2) {
> > + fputs("Excess arguments\n\n", stderr);
> > + fputs(cmd->cmd_help, stderr);
> > + exit(1);
> > + }
> > +
> > + fd = xopen(argv[1], O_WRONLY, 0);
> > +
> > + if (fsync(fd) != 0)
> > + die_errno("fsync failed");
> > +
> > + printf("fsync a file\n");
> > + exit(0);
> > +}
> > +
> > #define set_verity_desc "Set fs-verity"
> > #define set_verity_help \
> > "f2fs_io set_verity [file]\n\n" \
> > @@ -780,6 +804,7 @@ static void do_reserve_cblocks(int argc, char **argv, const struct cmd_desc *cmd
> > static void do_help(int argc, char **argv, const struct cmd_desc *cmd);
> > const struct cmd_desc cmd_list[] = {
> > _CMD(help),
> > + CMD(fsync),
> > CMD(set_verity),
> > CMD(getflags),
> > CMD(setflags),
> >
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2020-05-06 14:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 0:29 [f2fs-dev] [PATCH 1/3] f2fs_io: add fsync Jaegeuk Kim
2020-05-02 0:29 ` [f2fs-dev] [PATCH 2/3] f2fs_io: don't give garbage data in upper 32bits Jaegeuk Kim
2020-05-06 6:36 ` Chao Yu
2020-05-02 0:29 ` [f2fs-dev] [PATCH 3/3] f2fs_io: show more flags Jaegeuk Kim
2020-05-06 6:40 ` Chao Yu
2020-05-06 14:40 ` Jaegeuk Kim
2020-05-06 6:35 ` [f2fs-dev] [PATCH 1/3] f2fs_io: add fsync Chao Yu
2020-05-06 14:39 ` Jaegeuk Kim [this message]
2020-05-07 2:45 ` Chao Yu
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=20200506143945.GA107238@google.com \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=yuchao0@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).