Skip to contentSkip to conversation

f2fs_io: support get_advise command

PATCH New Chao Yu 1 participant 1 message Mar 7, 2024

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs_io: support get_advise command

Support get_advise command to get i_advise field value and info in file.

For example:
f2fs_io get_advise /mnt/f2fs/foo.so
i_advise=0x11, advise_type: cold keep_size

---
 man/f2fs_io.8           |  3 +++
 tools/f2fs_io/f2fs_io.c | 41 +++++++++++++++++++++++++++++++++++++++++
 tools/f2fs_io/f2fs_io.h |  6 ++++++
 3 files changed, 50 insertions(+)
man/f2fs_io.8 +3 -0
index ecaab02..f097bde 100644
@@ -171,6 +171,9 @@ Move a range of data blocks from source file to destination file
 .TP
 \fBgc_range\fR \fI[sync_mode] [start in 4kb] [length in 4kb] [file]\fR
 Trigger gc to move data blocks from specified address range
+.TP
+\fBget_advise\fR \fI[file]\fR
+Get i_advise value and info in file
 .SH AUTHOR
 This version of
 .B f2fs_io
tools/f2fs_io/f2fs_io.c +41 -0

53 lines not on this page · raw message

tools/f2fs_io/f2fs_io.h +6 -0
index d2641cb..b5c82f5 100644
@@ -169,7 +169,13 @@ struct fscrypt_get_policy_ex_arg {
 
 #define F2FS_SYSTEM_ADVISE_NAME	"system.advise"
 #define FADVISE_COLD_BIT	0x01
+#define FADVISE_LOST_PINO_BIT	0x02
+#define FADVISE_ENCRYPT_BIT	0x04
+#define FADVISE_ENC_NAME_BIT	0x08
+#define FADVISE_KEEP_SIZE_BIT	0x10
 #define FADVISE_HOT_BIT		0x20
+#define FADVISE_VERITY_BIT	0x40
+#define FADVISE_TRUNC_BIT	0x80
 
 #ifndef FS_IMMUTABLE_FL
 #define FS_IMMUTABLE_FL			0x00000010 /* Immutable file */
Signature · 8 lines
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel