git: a3c457398f26 - main - linux: add sysfs filetype support for Linux statfs()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 13 Apr 2026 22:32:41 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=a3c457398f269c913aaa4d9dedcc72a70c02e845
commit a3c457398f269c913aaa4d9dedcc72a70c02e845
Author: YAO, Xin <mr.yaoxin@outlook.com>
AuthorDate: 2026-04-04 14:02:59 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-04-13 22:32:12 +0000
linux: add sysfs filetype support for Linux statfs()
Added MAGIC number below and map to linsysfs in bsd_to_linux_ftype()
This maps:
- `linsysfs` -> `LINUX_SYSFS_MAGIC` (`0x62656572`)
Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com>
Reviewed by: emaste
Pull request: https://github.com/freebsd/freebsd-src/pull/2119
---
sys/compat/linux/linux_stats.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 03783d466211..6f96a219003b 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -295,26 +295,28 @@ struct l_statfs {
#define LINUX_ZFS_SUPER_MAGIC 0x2FC12FC1
#define LINUX_DEVFS_SUPER_MAGIC 0x1373L
#define LINUX_SHMFS_MAGIC 0x01021994
+#define LINUX_SYSFS_MAGIC 0x62656572
static long
bsd_to_linux_ftype(const char *fstypename)
{
int i;
static struct {const char *bsd_name; long linux_type;} b2l_tbl[] = {
- {"ufs", LINUX_UFS_SUPER_MAGIC},
- {"zfs", LINUX_ZFS_SUPER_MAGIC},
- {"cd9660", LINUX_ISOFS_SUPER_MAGIC},
- {"nfs", LINUX_NFS_SUPER_MAGIC},
- {"ext2fs", LINUX_EXT2_SUPER_MAGIC},
- {"procfs", LINUX_PROC_SUPER_MAGIC},
- {"msdosfs", LINUX_MSDOS_SUPER_MAGIC},
- {"ntfs", LINUX_NTFS_SUPER_MAGIC},
- {"nwfs", LINUX_NCP_SUPER_MAGIC},
- {"hpfs", LINUX_HPFS_SUPER_MAGIC},
- {"coda", LINUX_CODA_SUPER_MAGIC},
- {"devfs", LINUX_DEVFS_SUPER_MAGIC},
- {"tmpfs", LINUX_SHMFS_MAGIC},
- {NULL, 0L}};
+ {"ufs", LINUX_UFS_SUPER_MAGIC},
+ {"zfs", LINUX_ZFS_SUPER_MAGIC},
+ {"cd9660", LINUX_ISOFS_SUPER_MAGIC},
+ {"nfs", LINUX_NFS_SUPER_MAGIC},
+ {"ext2fs", LINUX_EXT2_SUPER_MAGIC},
+ {"procfs", LINUX_PROC_SUPER_MAGIC},
+ {"msdosfs", LINUX_MSDOS_SUPER_MAGIC},
+ {"ntfs", LINUX_NTFS_SUPER_MAGIC},
+ {"nwfs", LINUX_NCP_SUPER_MAGIC},
+ {"hpfs", LINUX_HPFS_SUPER_MAGIC},
+ {"coda", LINUX_CODA_SUPER_MAGIC},
+ {"devfs", LINUX_DEVFS_SUPER_MAGIC},
+ {"tmpfs", LINUX_SHMFS_MAGIC},
+ {"linsysfs", LINUX_SYSFS_MAGIC},
+ {NULL, 0L}};
for (i = 0; b2l_tbl[i].bsd_name != NULL; i++)
if (strcmp(b2l_tbl[i].bsd_name, fstypename) == 0)