@@ -22,11 +22,11 @@ Get the flags associated with the specified file.
.TP
\fBsetflags\fR \fI[flag] [file]\fR
Set an f2fs file on specified file. The flag can be casefold,
-compression, nocompression, immutable, and nocow.
+compression, nocompression, immutable, nocow, and nolinear_lookup.
.TP
\fBclearflags\fR \fI[flag] [file]\fR
Clear the specified flag on the target file, which can be compression,
- nocompression, immutable, and nocow.
+ nocompression, immutable, nocow, and nolinear_lookup.
.TP
\fBshutdown\fR \fIshutdown filesystem\fR
Freeze and stop all IOs for the file system mounted on
@@ -240,7 +240,8 @@ static void do_set_verity(int argc, char **argv, const struct cmd_desc *cmd)
" casefold\n" \
" compression\n" \
" nocompression\n" \
-" immutable\n"
+" immutable\n" \
+" nolinear_lookup\n"
static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -304,6 +305,12 @@ static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
printf("immutable");
exist = 1;
}
+ if (flag & F2FS_NOLINEAR_LOOKUP_FLAG) {
+ if (exist)
+ printf(",");
+ printf("nolinear_lookup");
+ exist = 1;
+ }
if (!exist)
printf("none");
printf("\n");
@@ -319,7 +326,8 @@ static void do_getflags(int argc, char **argv, const struct cmd_desc *cmd)
" compression\n" \
" nocompression\n" \
" immutable\n" \
-" nocow\n"
+" nocow\n" \
+" nolinear_lookup\n"
static void do_setflags(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -349,6 +357,8 @@ static void do_setflags(int argc, char **argv, const struct cmd_desc *cmd)
flag |= FS_IMMUTABLE_FL;
else if (!strcmp(argv[1], "nocow"))
flag |= FS_NOCOW_FL;
+ else if (!strcmp(argv[1], "nolinear_lookup"))
+ flag |= F2FS_NOLINEAR_LOOKUP_FLAG;
ret = ioctl(fd, F2FS_IOC_SETFLAGS, &flag);
printf("set a flag on %s ret=%d, flags=%s\n", argv[2], ret, argv[1]);
@@ -363,7 +373,8 @@ static void do_setflags(int argc, char **argv, const struct cmd_desc *cmd)
" compression\n" \
" nocompression\n" \
" immutable\n" \
-" nocow\n"
+" nocow\n" \
+" nolinear_lookup\n"
static void do_clearflags(int argc, char **argv, const struct cmd_desc *cmd)
{
@@ -391,6 +402,8 @@ static void do_clearflags(int argc, char **argv, const struct cmd_desc *cmd)
flag &= ~FS_IMMUTABLE_FL;
else if (!strcmp(argv[1], "nocow"))
flag &= ~FS_NOCOW_FL;
+ else if (!strcmp(argv[1], "nolinear_lookup"))
+ flag &= ~F2FS_NOLINEAR_LOOKUP_FLAG;
ret = ioctl(fd, F2FS_IOC_SETFLAGS, &flag);
printf("clear a flag on %s ret=%d, flags=%s\n", argv[2], ret, argv[1]);
@@ -246,3 +246,8 @@ struct f2fs_comp_option {
u8 algorithm;
u8 log_cluster_size;
};
+
+/* for F2FS_IOC_{GET,SET,CLEAR}_FLAGS_EX */
+enum {
+ F2FS_NOLINEAR_LOOKUP_FLAG = 0x08000000,
+};