From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [f2fs-dev] [PATCH 1/2] f2fs_io: add to show immutable bit
Date: Fri, 21 May 2021 12:00:04 -0700 [thread overview]
Message-ID: <20210521190005.2483242-1-jaegeuk@kernel.org> (raw)
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
tools/f2fs_io/f2fs_io.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index fa7d3f5e4b36..aa1a7e4dd623 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -213,7 +213,8 @@ static void do_set_verity(int argc, char **argv, const struct cmd_desc *cmd)
" verity\n" \
" casefold\n" \
" compression\n" \
-" nocompression\n"
+" nocompression\n" \
+" immutable\n"
static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -271,6 +272,12 @@ static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
printf("nocow(pinned)");
exist = 1;
}
+ if (flag & FS_IMMUTABLE_FL) {
+ if (exist)
+ printf(",");
+ printf("immutable");
+ exist = 1;
+ }
if (!exist)
printf("none");
printf("\n");
@@ -284,7 +291,8 @@ static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
"flag can be\n" \
" casefold\n" \
" compression\n" \
-" nocompression\n"
+" nocompression\n" \
+" noimmutable\n"
static void do_setflags(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -310,6 +318,8 @@ static void do_setflags(int argc, char **argv, const struct cmd_desc *cmd)
flag |= FS_COMPR_FL;
else if (!strcmp(argv[1], "nocompression"))
flag |= FS_NOCOMP_FL;
+ else if (!strcmp(argv[1], "noimmutable"))
+ flag &= ~FS_IMMUTABLE_FL;
ret = ioctl(fd, F2FS_IOC_SETFLAGS, &flag);
printf("set a flag on %s ret=%d, flags=%s\n", argv[2], ret, argv[1]);
--
2.31.1.818.g46aad6cb9e-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:[~2021-05-21 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 19:00 Jaegeuk Kim [this message]
2021-05-21 19:00 ` [f2fs-dev] [PATCH 2/2] f2fs-tools: support small RO partition Jaegeuk Kim
2021-05-26 9:06 ` [f2fs-dev] [PATCH 1/2] f2fs_io: add to show immutable bit 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=20210521190005.2483242-1-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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).