changeset 31627:814733e4c02a

statfs: detect more filesystems on Linux Previously, the code only has what manpager says. In <linux/magic.h>, there are more defined. This patch adds filesystems that appear in the current Arch Linux's /proc/filesystems (autofs, overlay, securityfs) and f2fs, which was seen in news.
author Jun Wu <quark@fb.com>
date Sat, 25 Mar 2017 12:58:55 -0700
parents 0febf8e4e2ce
children e86eb75e74ce
files mercurial/osutil.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/osutil.c	Thu Mar 23 23:47:23 2017 -0400
+++ b/mercurial/osutil.c	Sat Mar 25 12:58:55 2017 -0700
@@ -815,6 +815,10 @@
 	if (pbuf->f_type == AFFS_SUPER_MAGIC)
 		return "affs";
 #endif
+#ifdef AUTOFS_SUPER_MAGIC
+	if (pbuf->f_type == AUTOFS_SUPER_MAGIC)
+		return "autofs";
+#endif
 #ifdef BDEVFS_MAGIC
 	if (pbuf->f_type == BDEVFS_MAGIC)
 		return "bdevfs";
@@ -895,6 +899,10 @@
 	if (pbuf->f_type == EXT4_SUPER_MAGIC)
 		return "ext4";
 #endif
+#ifdef F2FS_SUPER_MAGIC
+	if (pbuf->f_type == F2FS_SUPER_MAGIC)
+		return "f2fs";
+#endif
 #ifdef FUSE_SUPER_MAGIC
 	if (pbuf->f_type == FUSE_SUPER_MAGIC)
 		return "fuse";
@@ -975,6 +983,10 @@
 	if (pbuf->f_type == OPENPROM_SUPER_MAGIC)
 		return "openprom";
 #endif
+#ifdef OVERLAYFS_SUPER_MAGIC
+	if (pbuf->f_type == OVERLAYFS_SUPER_MAGIC)
+		return "overlay";
+#endif
 #ifdef PIPEFS_MAGIC
 	if (pbuf->f_type == PIPEFS_MAGIC)
 		return "pipefs";
@@ -1007,6 +1019,10 @@
 	if (pbuf->f_type == ROMFS_MAGIC)
 		return "romfs";
 #endif
+#ifdef SECURITYFS_MAGIC
+	if (pbuf->f_type == SECURITYFS_MAGIC)
+		return "securityfs";
+#endif
 #ifdef SELINUX_MAGIC
 	if (pbuf->f_type == SELINUX_MAGIC)
 		return "selinux";