@@ -62,7 +62,7 @@ int f2fs_rebuild_qf_inode(struct f2fs_sb_info *sbi, int qtype)
raw_node->i.i_size = cpu_to_le64(1024 * 6);
raw_node->i.i_blocks = cpu_to_le64(1);
- raw_node->i.i_flags = FS_IMMUTABLE_FL;
+ raw_node->i.i_flags = F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL;
if (is_set_ckpt_flags(ckpt, CP_CRC_RECOVERY_FLAG))
cp_ver |= (cur_cp_crc(ckpt) << 32);
@@ -750,7 +750,12 @@ enum {
#define QUOTA_DATA(i) (2)
#define QUOTA_INO(sb,t) (le32_to_cpu((sb)->qf_ino[t]))
-#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
+/*
+ * On-disk inode flags (f2fs_inode::i_flags)
+ */
+#define F2FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#define F2FS_NOATIME_FL 0x00000080 /* do not update atime */
+
#define F2FS_ENC_UTF8_12_1 1
#define F2FS_ENC_STRICT_MODE_FL (1 << 0)
@@ -1364,7 +1364,7 @@ static int f2fs_write_qf_inode(int qtype, int offset)
raw_node->i.i_size = cpu_to_le64(1024 * 6);
raw_node->i.i_blocks = cpu_to_le64(1 + QUOTA_DATA(qtype));
- raw_node->i.i_flags = FS_IMMUTABLE_FL;
+ raw_node->i.i_flags = F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL;
raw_node->footer.next_blkaddr = cpu_to_le32(
get_sb(main_blkaddr) +
@@ -167,6 +167,10 @@ struct fscrypt_get_policy_ex_arg {
#define F2FS_IOC_FSGETXATTR FS_IOC_FSGETXATTR
#define F2FS_IOC_FSSETXATTR FS_IOC_FSSETXATTR
+#ifndef FS_IMMUTABLE_FL
+#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#endif
+
#ifndef FS_ENCRYPT_FL
#define FS_ENCRYPT_FL 0x00000800 /* Encrypted file */
#endif
Disk quota file is controlled by filesystem quota subsystem, access time of quota file is almost random, and should be meanless to user, so let's add noatime to quota file. Meanwhile, set quota file w/ F2FS_IMMUTABLE_FL instead of FS_IMMUTABLE_FL, since F2FS_IMMUTABLE_FL is on-disk flag, however FS_IMMUTABLE_FL is in-memory one. Signed-off-by: Chao Yu <chao@kernel.org> --- fsck/node.c | 2 +- include/f2fs_fs.h | 7 ++++++- mkfs/f2fs_format.c | 2 +- tools/f2fs_io/f2fs_io.h | 4 ++++ 4 files changed, 12 insertions(+), 3 deletions(-)