Skip to contentSkip to conversation

shmem: Report casefold setting in mount options

PATCH New Gabriel Krisman Bertazi 1 participant 1 message Oct 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shmem: Report casefold setting in mount options

For shmem, casefolding is a mount option. Report the current encoding and casefolding flags in /proc/mounts, so userspace can easily check if casefolding is supported withour relying on parsing dmesg or trying to set +F.

---
 mm/shmem.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
mm/shmem.c +11 -0
index 848316eaa7f4..bf3b19ed2e44 100644
@@ -4919,6 +4919,17 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
 	if (sbinfo->qlimits.grpquota_ihardlimit)
 		seq_printf(seq, ",grpquota_inode_hardlimit=%lld",
 			   sbinfo->qlimits.grpquota_ihardlimit);
+#endif
+#if IS_ENABLED(CONFIG_UNICODE)
+	if (root->d_sb->s_encoding) {
+		unsigned int version = root->d_sb->s_encoding->version;
+
+		seq_printf(seq, ",casefold=utf8-%u.%u.%u",
+			   unicode_major(version), unicode_minor(version),
+			   unicode_rev(version));
+		if (sb_has_strict_encoding(root->d_sb))
+			seq_puts(seq, ",strict_encoding");
+	}
 #endif
 	return 0;
 }
Signature · 1 line
2.56.0